udbexpand.c => udb.c
[unix-history] / usr / src / usr.sbin / sliplogin / sliplogin.8
CommitLineData
b42074ab 1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
8a41c435
KB
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
162fb34f 6.\" @(#)sliplogin.8 5.4 (Berkeley) %G%
8a41c435 7.\"
b42074ab
CL
8.Dd
9.Dt SLIPLOGIN 8
10.Os
11.Sh NAME
12.Nm sliplogin
13.Nd attach a serial line network interface
14.Sh SYNOPSIS
15.Nm sliplogin
16.Op Ar loginname
17.Sh DESCRIPTION
18.Nm Sliplogin
7569cceb 19is used to turn the terminal line on standard input into
b42074ab
CL
20a Serial Line IP
21.Pq Tn SLIP
22link to a remote host. To do this, the program
7569cceb 23searches the file
b42074ab 24.Pa /etc/slip.hosts
7569cceb 25for an entry matching
b42074ab 26.Ar loginname
7569cceb
TH
27(which defaults to the current login name if omitted).
28If a matching entry is found, the line is configured appropriately
b42074ab
CL
29for slip (8-bit transparent i/o) and converted to
30.Tn SLIP
31line
7569cceb 32discipline. Then a shell script is invoked to initialize the slip
b42074ab
CL
33interface with the appropriate local and remote
34.Tn IP
35address,
7569cceb 36netmask, etc.
b42074ab 37.Pp
7569cceb 38The usual initialization script is
b42074ab 39.Pa /etc/slip.login
7569cceb 40but, if particular hosts need special initialization, the file
b42074ab 41.Pa /etc/slip.login. Ns Ar loginname
7569cceb
TH
42will be executed instead if it exists.
43The script is invoked with the parameters
b42074ab
CL
44.Bl -tag -width slipunit
45.It Em slipunit
7569cceb 46The unit number of the slip interface assigned to this line. E.g.,
b42074ab 47.Sy 0
7569cceb 48for
b42074ab
CL
49.Sy sl0 .
50.It Em speed
7569cceb 51The speed of the line.
b42074ab 52.It Em args
7569cceb 53The arguments from the
b42074ab 54.Pa /etc/slip.hosts
7569cceb 55entry, in order starting with
b42074ab
CL
56.Ar loginname .
57.El
58.Pp
8a41c435 59Only the super-user may attach a network interface. The interface is
7569cceb 60automatically detached when the other end hangs up or the
b42074ab 61.Nm sliplogin
7569cceb 62process dies. If the kernel slip
8a41c435 63module has been configured for it, all routes through that interface will
7569cceb
TH
64also disappear at the same time. If there is other processing a site
65would like done on hangup, the file
b42074ab 66.Pa /etc/slip.logout
7569cceb 67or
b42074ab 68.Pa /etc/slip.logout. Ns Ar loginname
7569cceb 69is executed if it exists. It is given the same arguments as the login script.
b42074ab 70.Ss Format of /etc/slip.hosts
7569cceb
TH
71Comments (lines starting with a `#') and blank lines are ignored.
72Other lines must start with a
b42074ab 73.Ar loginname
7569cceb 74but the remaining arguments can be whatever is appropriate for the
b42074ab 75.Pa slip.login
7569cceb
TH
76file that will be executed for that name.
77Arguments are separated by white space and follow normal
b42074ab 78.Xr sh 1
7569cceb 79quoting conventions (however,
b42074ab 80.Ar loginname
7569cceb
TH
81cannot be quoted).
82Usually, lines have the form
b42074ab 83.Bd -literal -offset indent
7569cceb 84loginname local-address remote-address netmask opt-args
b42074ab
CL
85.Ed
86.Pp
7569cceb 87where
b42074ab 88.Em local-address
7569cceb 89and
b42074ab 90.Em remote-address
7569cceb
TH
91are the IP host names or addresses of the local and remote ends of the
92slip line and
b42074ab 93.Em netmask
7569cceb
TH
94is the appropriate IP netmask. These arguments are passed
95directly to
b42074ab
CL
96.Xr ifconfig 8 .
97.Em Opt-args
7569cceb 98are optional arguments used to configure the line.
b42074ab 99.Sh EXAMPLE
7569cceb 100The normal use of
b42074ab 101.Nm sliplogin
7569cceb 102is to create a
b42074ab 103.Pa /etc/passwd
7569cceb 104entry for each legal, remote slip site with
b42074ab 105.Nm sliplogin
7569cceb 106as the shell for that entry. E.g.,
b42074ab 107.Bd -literal
7569cceb 108Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/etc/sliplogin
b42074ab
CL
109.Ed
110.Pp
7569cceb 111(Our convention is to name the account used by remote host
b42074ab 112.Ar hostname
7569cceb 113as
b42074ab 114.Em Shostname . )
7569cceb 115Then an entry is added to
b42074ab 116.Pa slip.hosts
7569cceb 117that looks like:
b42074ab
CL
118.Pp
119.Bd -literal -offset indent -compact
7569cceb 120Sfoo `hostname` foo netmask
b42074ab
CL
121.Ed
122.Pp
7569cceb 123where
b42074ab 124.Em `hostname`
7569cceb 125will be evaluated by
b42074ab 126.Xr sh
7569cceb 127to the local host name and
b42074ab 128.Em netmask
7569cceb 129is the local host IP netmask.
b42074ab 130.Pp
7569cceb 131Note that
b42074ab 132.Nm sliplogin
7569cceb
TH
133must be setuid to root and, while not a security hole, moral defectives
134can use it to place terminal lines in an unusable state and/or deny
135access to legitimate users of a remote slip line. To prevent this,
136a site can create a group, say
b42074ab 137.Em slip ,
7569cceb 138that only the slip login accounts are put in then make sure that
b42074ab 139.Pa /etc/sliplogin
7569cceb 140is in group
b42074ab 141.Em slip
7569cceb 142and mode 4550 (setuid root, only group
b42074ab 143.Em slip
7569cceb 144can execute binary).
b42074ab
CL
145.Sh DIAGNOSTICS
146.Nm Sliplogin
8a41c435 147logs various information to the system log daemon,
b42074ab 148.Xr syslogd 8 ,
8a41c435 149with a facility code of
b42074ab 150.Em daemon .
8a41c435 151The messages are listed here, grouped by severity level.
162fb34f 152.Pp
b42074ab 153.Sy Error Severity
162fb34f 154.Bl -tag -width Ds -compact
b42074ab 155.It Sy ioctl (TCGETS): Em reason
8a41c435 156A
b42074ab
CL
157.Dv TCGETS
158.Fn ioctl
8a41c435 159to get the line parameters failed.
162fb34f 160.Pp
b42074ab 161.It Sy ioctl (TCSETS): Em reason
8a41c435 162A
b42074ab
CL
163.Dv TCSETS
164.Fn ioctl
8a41c435 165to set the line parameters failed.
162fb34f 166.Pp
b42074ab 167.It Sy /etc/slip.hosts: Em reason
8a41c435 168The
b42074ab 169.Pa /etc/slip.hosts
8a41c435 170file could not be opened.
162fb34f 171.Pp
b42074ab 172.It Sy access denied for Em user
7569cceb 173No entry for
b42074ab 174.Em user
7569cceb 175was found in
b42074ab
CL
176.Pa /etc/slip.hosts .
177.El
178.Pp
179.Sy Notice Severity
162fb34f 180.Bl -tag -width Ds -compact
b42074ab
CL
181.It Sy "attaching slip unit" Em unit Sy for Ar loginname
182.Tn SLIP
183unit
184.Em unit
7569cceb 185was successfully attached.
b42074ab
CL
186.El
187.Sh SEE ALSO
188.Xr slattach 8 ,
189.Xr syslogd 8
190.Sh HISTORY
191The
192.Nm
193command
194.Bt