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