xref: /netbsd/usr.sbin/sliplogin/sliplogin.8 (revision bf9ec67e)
1.\"	$NetBSD: sliplogin.8,v 1.8 2002/02/02 01:51:20 wiz Exp $
2.\"
3.\" Copyright (c) 1990, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)sliplogin.8	8.2 (Berkeley) 1/5/94
35.\"
36.Dd January 5, 1994
37.Dt SLIPLOGIN 8
38.Os
39.Sh NAME
40.Nm sliplogin
41.Nd attach a serial line network interface
42.Sh SYNOPSIS
43.Nm
44.Op Ar loginname
45.Sh DESCRIPTION
46.Nm
47is used to turn the terminal line on standard input into
48a Serial Line IP
49.Pq Tn SLIP
50link to a remote host.  To do this, the program
51searches the file
52.Pa /etc/sliphome/slip.hosts
53for an entry matching
54.Ar loginname
55(which defaults to the current login name if omitted).
56If a matching entry is found, the line is configured appropriately
57for slip (8-bit transparent i/o) and converted to
58.Tn SLIP
59line
60discipline.  Then a shell script is invoked to initialize the slip
61interface with the appropriate local and remote
62.Tn IP
63address,
64netmask, etc.
65.Pp
66The usual initialization script is
67.Pa /etc/sliphome/slip.login
68but, if particular hosts need special initialization, the file
69.Pa /etc/sliphome/slip.login. Ns Ar loginname
70will be executed instead if it exists.
71The script is invoked with the parameters
72.Bl -tag -width slipunit
73.It Em slipunit
74The unit number of the slip interface assigned to this line.  E.g.,
75.Sy 0
76for
77.Sy sl0 .
78.It Em speed
79The speed of the line.
80.It Em args
81The arguments from the
82.Pa /etc/sliphome/slip.hosts
83entry, in order starting with
84.Ar loginname .
85.El
86.Pp
87Only the super-user may attach a network interface.  The interface is
88automatically detached when the other end hangs up or the
89.Nm
90process dies.  If the kernel slip
91module has been configured for it, all routes through that interface will
92also disappear at the same time.  If there is other processing a site
93would like done on hangup, the file
94.Pa /etc/sliphome/slip.logout
95or
96.Pa /etc/sliphome/slip.logout. Ns Ar loginname
97is executed if it exists.  It is given the same arguments as the login script.
98.Ss Format of /etc/sliphome/slip.hosts
99Comments (lines starting with a `#') and blank lines are ignored.
100Other lines must start with a
101.Ar loginname
102but the remaining arguments can be whatever is appropriate for the
103.Pa  slip.login
104file that will be executed for that name.
105Arguments are separated by white space and follow normal
106.Xr sh 1
107quoting conventions (however,
108.Ar loginname
109cannot be quoted).
110Usually, lines have the form
111.Bd -literal -offset indent
112loginname local-address remote-address netmask opt-args
113.Ed
114.Pp
115where
116.Em local-address
117and
118.Em remote-address
119are the IP host names or addresses of the local and remote ends of the
120slip line and
121.Em netmask
122is the appropriate IP netmask.  These arguments are passed
123directly to
124.Xr ifconfig 8 .
125.Em opt-args
126are optional arguments used to configure the line.
127.Sh EXAMPLES
128The normal use of
129.Nm
130is to create a
131.Pa /etc/passwd
132entry for each legal, remote slip site with
133.Nm
134as the shell for that entry.  E.g.,
135.Bd -literal
136Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin
137.Ed
138.Pp
139(Our convention is to name the account used by remote host
140.Ar hostname
141as
142.Em Shostname . )
143Then an entry is added to
144.Pa slip.hosts
145that looks like:
146.Pp
147.Bd -literal -offset indent -compact
148Sfoo	`hostname`	foo	netmask
149.Ed
150.Pp
151where
152.Em `hostname`
153will be evaluated by
154.Xr sh 1
155to the local host name and
156.Em netmask
157is the local host IP netmask.
158.Pp
159Note that
160.Nm
161must be setuid to root and, while not a security hole, moral defectives
162can use it to place terminal lines in an unusable state and/or deny
163access to legitimate users of a remote slip line.  To prevent this,
164a site can create a group, say
165.Em slip ,
166that only the slip login accounts are put in then make sure that
167.Pa /usr/sbin/sliplogin
168is in group
169.Em slip
170and mode 4550 (setuid root, only group
171.Em slip
172can execute binary).
173.Sh DIAGNOSTICS
174.Nm
175logs various information to the system log daemon,
176.Xr syslogd 8 ,
177with a facility code of
178.Em daemon .
179The messages are listed here, grouped by severity level.
180.Pp
181.Sy Error Severity
182.Bl -tag -width Ds -compact
183.It Sy ioctl (TCGETS): Em reason
184A
185.Dv TCGETS
186.Fn ioctl
187to get the line parameters failed.
188.Pp
189.It Sy ioctl (TCSETS): Em reason
190A
191.Dv TCSETS
192.Fn ioctl
193to set the line parameters failed.
194.Pp
195.It Sy /etc/sliphome/slip.hosts: Em reason
196The
197.Pa /etc/sliphome/slip.hosts
198file could not be opened.
199.Pp
200.It Sy access denied for Em user
201No entry for
202.Em user
203was found in
204.Pa /etc/sliphome/slip.hosts .
205.El
206.Pp
207.Sy Notice Severity
208.Bl -tag -width Ds -compact
209.It Sy "attaching slip unit" Em unit Sy for Ar loginname
210.Tn SLIP
211unit
212.Em unit
213was successfully attached.
214.El
215.Sh SEE ALSO
216.Xr sl 4 ,
217.Xr slattach 8 ,
218.Xr syslogd 8
219.Sh HISTORY
220The
221.Nm
222command
223.Bt
224