1*a1961053Swiz.\" $NetBSD: sliplogin.8,v 1.11 2018/11/14 18:28:18 wiz Exp $ 218b882a9Smrg.\" 318b882a9Smrg.\" Copyright (c) 1990, 1991, 1993 418b882a9Smrg.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 14326b2259Sagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 3018b882a9Smrg.\" from: @(#)sliplogin.8 8.2 (Berkeley) 1/5/94 3161f28255Scgd.\" 32782f4599Schristos.Dd November 11, 2018 3361f28255Scgd.Dt SLIPLOGIN 8 3461f28255Scgd.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm sliplogin 3761f28255Scgd.Nd attach a serial line network interface 3861f28255Scgd.Sh SYNOPSIS 39745600d8Slukem.Nm 4061f28255Scgd.Op Ar loginname 4161f28255Scgd.Sh DESCRIPTION 42745600d8Slukem.Nm 4361f28255Scgdis used to turn the terminal line on standard input into 4461f28255Scgda Serial Line IP 4561f28255Scgd.Pq Tn SLIP 46*a1961053Swizlink to a remote host. 47*a1961053SwizTo do this, the program searches the file 48a33e17efScgd.Pa /etc/sliphome/slip.hosts 4961f28255Scgdfor an entry matching 5061f28255Scgd.Ar loginname 5161f28255Scgd(which defaults to the current login name if omitted). 5261f28255ScgdIf a matching entry is found, the line is configured appropriately 5361f28255Scgdfor slip (8-bit transparent i/o) and converted to 5461f28255Scgd.Tn SLIP 5561f28255Scgdline 56*a1961053Swizdiscipline. 57*a1961053SwizThen a shell script is invoked to initialize the slip interface 58*a1961053Swizwith the appropriate local and remote IP address, netmask, etc. 5961f28255Scgd.Pp 6061f28255ScgdThe usual initialization script is 61a33e17efScgd.Pa /etc/sliphome/slip.login 6261f28255Scgdbut, if particular hosts need special initialization, the file 63a33e17efScgd.Pa /etc/sliphome/slip.login. Ns Ar loginname 6461f28255Scgdwill be executed instead if it exists. 6561f28255ScgdThe script is invoked with the parameters 6661f28255Scgd.Bl -tag -width slipunit 6761f28255Scgd.It Em slipunit 68*a1961053SwizThe unit number of the slip interface assigned to this line. 69*a1961053SwizE.g., 7061f28255Scgd.Sy 0 7161f28255Scgdfor 7261f28255Scgd.Sy sl0 . 7361f28255Scgd.It Em speed 7461f28255ScgdThe speed of the line. 7561f28255Scgd.It Em args 7661f28255ScgdThe arguments from the 77a33e17efScgd.Pa /etc/sliphome/slip.hosts 7861f28255Scgdentry, in order starting with 7961f28255Scgd.Ar loginname . 8061f28255Scgd.El 8161f28255Scgd.Pp 82*a1961053SwizOnly the super-user may attach a network interface. 83*a1961053SwizThe interface is 8461f28255Scgdautomatically detached when the other end hangs up or the 85745600d8Slukem.Nm 86*a1961053Swizprocess dies. 87*a1961053SwizIf the kernel slip module has been configured for it, all routes 88*a1961053Swizthrough that interface will also disappear at the same time. 89*a1961053SwizIf there is other processing a site would like done on hangup, the file 90a33e17efScgd.Pa /etc/sliphome/slip.logout 9161f28255Scgdor 92a33e17efScgd.Pa /etc/sliphome/slip.logout. Ns Ar loginname 93*a1961053Swizis executed if it exists. 94*a1961053SwizIt is given the same arguments as the login script. 95a33e17efScgd.Ss Format of /etc/sliphome/slip.hosts 9661f28255ScgdComments (lines starting with a `#') and blank lines are ignored. 9761f28255ScgdOther lines must start with a 9861f28255Scgd.Ar loginname 9961f28255Scgdbut the remaining arguments can be whatever is appropriate for the 10061f28255Scgd.Pa slip.login 10161f28255Scgdfile that will be executed for that name. 10261f28255ScgdArguments are separated by white space and follow normal 10361f28255Scgd.Xr sh 1 10461f28255Scgdquoting conventions (however, 10561f28255Scgd.Ar loginname 10661f28255Scgdcannot be quoted). 10761f28255ScgdUsually, lines have the form 10861f28255Scgd.Bd -literal -offset indent 10961f28255Scgdloginname local-address remote-address netmask opt-args 11061f28255Scgd.Ed 11161f28255Scgd.Pp 11261f28255Scgdwhere 11361f28255Scgd.Em local-address 11461f28255Scgdand 11561f28255Scgd.Em remote-address 11661f28255Scgdare the IP host names or addresses of the local and remote ends of the 11761f28255Scgdslip line and 11861f28255Scgd.Em netmask 119*a1961053Swizis the appropriate IP netmask. 120*a1961053SwizThese arguments are passed directly to 12161f28255Scgd.Xr ifconfig 8 . 122745600d8Slukem.Em opt-args 12361f28255Scgdare optional arguments used to configure the line. 124*a1961053Swiz.Sh FILES 125*a1961053Swiz.Bl -tag -width /usr/share/examples/slip/slip.login -compact 126*a1961053Swiz.It Pa /usr/share/examples/slip/slip.login 127*a1961053SwizSample slip.login script 128*a1961053Swiz.It Pa /etc/sliphome/slip.login.loginname 129*a1961053SwizLogin script for 130*a1961053Swiz.Em loginname 131*a1961053Swiz.It Pa /etc/sliphome/slip.hosts 132*a1961053SwizPer host settings 133*a1961053Swiz.El 13460ea852eSwiz.Sh EXAMPLES 13561f28255ScgdThe normal use of 136745600d8Slukem.Nm 13761f28255Scgdis to create a 13861f28255Scgd.Pa /etc/passwd 13961f28255Scgdentry for each legal, remote slip site with 140745600d8Slukem.Nm 141*a1961053Swizas the shell for that entry. 142*a1961053SwizFor example: 14361f28255Scgd.Bd -literal 144a33e17efScgdSfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin 14561f28255Scgd.Ed 14661f28255Scgd.Pp 14761f28255Scgd(Our convention is to name the account used by remote host 14861f28255Scgd.Ar hostname 14961f28255Scgdas 15061f28255Scgd.Em Shostname . ) 15161f28255ScgdThen an entry is added to 15261f28255Scgd.Pa slip.hosts 15361f28255Scgdthat looks like: 15461f28255Scgd.Pp 15561f28255Scgd.Bd -literal -offset indent -compact 15661f28255ScgdSfoo `hostname` foo netmask 15761f28255Scgd.Ed 15861f28255Scgd.Pp 15961f28255Scgdwhere 16061f28255Scgd.Em `hostname` 16161f28255Scgdwill be evaluated by 162aa3d785eSwiz.Xr sh 1 16361f28255Scgdto the local host name and 16461f28255Scgd.Em netmask 16561f28255Scgdis the local host IP netmask. 16661f28255Scgd.Pp 16761f28255ScgdNote that 168745600d8Slukem.Nm 16961f28255Scgdmust be setuid to root and, while not a security hole, moral defectives 17061f28255Scgdcan use it to place terminal lines in an unusable state and/or deny 171*a1961053Swizaccess to legitimate users of a remote slip line. 172*a1961053SwizTo prevent this, a site can create a group, say 17361f28255Scgd.Em slip , 17461f28255Scgdthat only the slip login accounts are put in then make sure that 175a33e17efScgd.Pa /usr/sbin/sliplogin 17661f28255Scgdis in group 17761f28255Scgd.Em slip 17861f28255Scgdand mode 4550 (setuid root, only group 17961f28255Scgd.Em slip 18061f28255Scgdcan execute binary). 18161f28255Scgd.Sh DIAGNOSTICS 182745600d8Slukem.Nm 18361f28255Scgdlogs various information to the system log daemon, 18461f28255Scgd.Xr syslogd 8 , 18561f28255Scgdwith a facility code of 18661f28255Scgd.Em daemon . 18761f28255ScgdThe messages are listed here, grouped by severity level. 18861f28255Scgd.Pp 18961f28255Scgd.Sy Error Severity 19061f28255Scgd.Bl -tag -width Ds -compact 19161f28255Scgd.It Sy ioctl (TCGETS): Em reason 19261f28255ScgdA 19361f28255Scgd.Dv TCGETS 19461f28255Scgd.Fn ioctl 19561f28255Scgdto get the line parameters failed. 19661f28255Scgd.Pp 19761f28255Scgd.It Sy ioctl (TCSETS): Em reason 19861f28255ScgdA 19961f28255Scgd.Dv TCSETS 20061f28255Scgd.Fn ioctl 20161f28255Scgdto set the line parameters failed. 20261f28255Scgd.Pp 203a33e17efScgd.It Sy /etc/sliphome/slip.hosts: Em reason 20461f28255ScgdThe 205a33e17efScgd.Pa /etc/sliphome/slip.hosts 20661f28255Scgdfile could not be opened. 20761f28255Scgd.Pp 20861f28255Scgd.It Sy access denied for Em user 20961f28255ScgdNo entry for 21061f28255Scgd.Em user 21161f28255Scgdwas found in 212a33e17efScgd.Pa /etc/sliphome/slip.hosts . 21361f28255Scgd.El 21461f28255Scgd.Pp 21561f28255Scgd.Sy Notice Severity 21661f28255Scgd.Bl -tag -width Ds -compact 21761f28255Scgd.It Sy "attaching slip unit" Em unit Sy for Ar loginname 21861f28255Scgd.Tn SLIP 21961f28255Scgdunit 22061f28255Scgd.Em unit 22161f28255Scgdwas successfully attached. 22261f28255Scgd.El 22361f28255Scgd.Sh SEE ALSO 22422018a84Sexplorer.Xr sl 4 , 22561f28255Scgd.Xr slattach 8 , 22661f28255Scgd.Xr syslogd 8 22761f28255Scgd.Sh HISTORY 22861f28255ScgdThe 22961f28255Scgd.Nm 23061f28255Scgdcommand 23161f28255Scgd.Bt 232