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