xref: /dragonfly/usr.sbin/sliplogin/sliplogin.8 (revision 2cd2d2b5)
1.\" Copyright (c) 1990, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
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.
19.\"
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.
31.\"
32.\"     @(#)sliplogin.8	8.2 (Berkeley) 1/5/94
33.\" $FreeBSD: src/usr.sbin/sliplogin/sliplogin.8,v 1.12.2.5 2003/03/11 22:31:33 trhodes Exp $
34.\" $DragonFly: src/usr.sbin/sliplogin/sliplogin.8,v 1.2 2003/06/17 04:30:03 dillon Exp $
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 Op Ar device
45.Sh DESCRIPTION
46The
47.Nm
48utility is used to turn the terminal line on standard input (or
49.Ar device )
50into a Serial Line IP
51.Pq Tn SLIP
52link to a remote host.  To do this, the program
53searches the file
54.Pa /etc/sliphome/slip.hosts
55for an entry matching
56.Ar loginname
57(which defaults to the current login name if omitted).
58If a matching entry is found, the line is configured appropriately
59for slip (8-bit transparent i/o) and converted to
60.Tn SLIP
61line discipline using the optional line discipline parameters.
62.Pp
63The optional line discipline parameters consist of one or more of
64the following;
65.Sq normal ,
66.Sq compress ,
67.Sq noicmp ,
68or
69.Sq autocomp
70which correspond respectively to
71.Sq use normal line discipline
72(no header compression),
73.Sq enable VJ header compression ,
74.Sq throw away ICMP packets ,
75and
76.Sq auto enable VJ header compression
77(only if the remote end of the link also supports it).
78.Pp
79Then a shell script is invoked to initialize the slip
80interface with the appropriate local and remote
81.Tn IP
82address,
83netmask, etc.
84.Pp
85The usual initialization script is
86.Pa /etc/sliphome/slip.login
87but, if particular hosts need special initialization, the file
88.Pa /etc/sliphome/slip.login. Ns Ar loginname
89will be executed instead if it exists.
90The script is invoked with the parameters
91.Bl -tag -width slipunit
92.It Em slipunit
93The unit number of the slip interface assigned to this line.  E.g.,
94.Sy 0
95for
96.Sy sl0 .
97.It Em speed
98The speed of the line.
99.It Em args
100The arguments from the
101.Pa /etc/sliphome/slip.hosts
102entry, in order starting with
103.Ar loginname .
104.El
105.Pp
106Only the super-user may attach a network interface.  The interface is
107automatically detached when the other end hangs up or the
108.Nm
109process dies.  If the kernel slip
110module has been configured for it, all routes through that interface will
111also disappear at the same time.  If there is other processing a site
112would like done on hangup, the file
113.Pa /etc/sliphome/slip.logout
114or
115.Pa /etc/sliphome/slip.logout. Ns Ar loginname
116is executed if it exists.  It is given the same arguments as the login script.
117.Ss Format of /etc/sliphome/slip.hosts
118Comments (lines starting with a `#') and blank lines (or started
119with space) are ignored.
120Other lines must start with a
121.Ar loginname
122but the remaining arguments can be whatever is appropriate for the
123.Pa  slip.login
124file that will be executed for that name.
125Arguments are separated by white space and follow normal
126.Xr sh 1
127quoting conventions (however,
128.Ar loginname
129cannot be quoted).
130Usually, lines have the form
131.Bd -literal -offset indent
132loginname local-address remote-address netmask opt-args
133.Ed
134.Pp
135where
136.Em local-address
137and
138.Em remote-address
139are the IP host names or addresses of the local and remote ends of the
140slip line and
141.Em netmask
142is the appropriate IP netmask.  These arguments are passed
143directly to
144.Xr ifconfig 8 .
145.Em Opt-args
146are optional arguments used to configure the line.
147.Sh FreeBSD Additions
148An additional SLIP configuration file (if present) is
149.Pa /etc/sliphome/slip.slparms .
150If particular hosts need different configurations, the file
151.Pa /etc/sliphome/slip.slparms. Ns Ar loginname
152will be parsed instead if it exists.
153.Ss Format of /etc/sliphome/slip.slparms*
154Comments (lines starting with a `#') and blank lines (or started with
155space) are ignored.
156This file contains from one to three numeric parameters separated with spaces,
157in order:
158.Ar keepalive ,
159.Ar outfill
160and
161.Ar slunit .
162.Bl -tag -width keepalive
163.It Ar keepalive
164Set SLIP "keep alive" timeout in seconds.
165If FRAME_END is not received in
166this amount of time,
167.Nm
168closes the line and exits.
169The default value is no timeout (zero).
170.It Ar outfill
171Set SLIP "out fill" timeout in seconds.
172It forces at least one FRAME_END
173to be sent during this time period, which is necessary for the "keep alive"
174timeout on the remote side.
175The default value is no timeout (zero).
176.It Ar slunit
177Set the SLIP unit number directly.
178Use with caution, because no check is made
179for two interfaces with same number.
180By default sliplogin dynamically assigns the unit number.
181.El
182.Pp
183If latter two parameters are omitted, they will not affect the
184corresponding SLIP configuration.
185If any of first two parameters is equal to zero, it will not affect
186the corresponding SLIP configuration.
187.Sh EXAMPLES
188The normal use of
189.Nm
190is to create a
191.Pa /etc/passwd
192entry for each legal, remote slip site with
193.Nm
194as the shell for that entry.  E.g.,
195.Bd -literal
196Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin
197.Ed
198.Pp
199(Our convention is to name the account used by remote host
200.Ar hostname
201as
202.Em Shostname . )
203Then an entry is added to
204.Pa slip.hosts
205that looks like:
206.Pp
207.Bd -literal -offset indent -compact
208Sfoo	`hostname`	foo	netmask
209.Ed
210.Pp
211where
212.Em `hostname`
213will be evaluated by
214.Xr sh
215to the local host name and
216.Em netmask
217is the local host IP netmask.
218.Pp
219Note that
220.Nm
221must be setuid to root and, while not a security hole, moral defectives
222can use it to place terminal lines in an unusable state and/or deny
223access to legitimate users of a remote slip line.  To prevent this,
224.Nm
225is installed as user
226.Em root ,
227group
228.Em network
229and mode 4550 so that only members of group
230.Em network
231may run
232.Nm .
233The system administrator should make sure that all legitimate users
234are a member of the correct group.
235.Sh DIAGNOSTICS
236The
237.Nm
238utility logs various information to the system log daemon,
239.Xr syslogd 8 ,
240with a facility code of
241.Em daemon .
242The messages are listed here, grouped by severity level.
243.Pp
244.Sy Error Severity
245.Bl -tag -width Ds -compact
246.It Sy ioctl (TCGETS): Em reason
247A
248.Dv TCGETS
249.Fn ioctl
250to get the line parameters failed.
251.Pp
252.It Sy ioctl (TCSETS): Em reason
253A
254.Dv TCSETS
255.Fn ioctl
256to set the line parameters failed.
257.Pp
258.It Sy /etc/sliphome/slip.hosts: Em reason
259The
260.Pa /etc/sliphome/slip.hosts
261file could not be opened.
262.Pp
263.It Sy access denied for Em user
264No entry for
265.Em user
266was found in
267.Pa /etc/sliphome/slip.hosts .
268.El
269.Pp
270.Sy Notice Severity
271.Bl -tag -width Ds -compact
272.It Sy "attaching slip unit" Em unit Sy for Ar loginname
273.Tn SLIP
274unit
275.Em unit
276was successfully attached.
277.El
278.Sh FILES
279.Bl -tag -width indent
280.It Pa /etc/sliphome/slip.hosts
281list of host login names and parameters.
282.It Pa /etc/sliphome/slip.login
283script executed when a connection is made.
284.It Pa /etc/sliphome/slip.login. Ns Ar loginname
285script executed when a connection is made by
286.Ar loginname .
287.It Pa /etc/sliphome/slip.logout
288script executed when a connection is lost.
289.It Pa /etc/sliphome/slip.logout. Ns Ar loginname
290script executed when a connection is lost by
291.Ar loginname .
292.It Pa /etc/sliphome/slip.slparms
293extra parameters file.
294.It Pa /etc/sliphome/slip.slparms. Ns Ar loginname
295extra parameters file for
296.Ar loginname .
297.It Pa /var/run/ Ns Ar ttyXn Ns Pa .if
298contains the name of the network interface used by the sliplogin process on
299.Ar ttyXn .
300.It Pa /var/run/ Ns Ar slX Ns Pa .pid
301contains the PID of the sliplogin process which is using interface
302.Ar slX .
303.El
304.Sh SEE ALSO
305.Xr slattach 8 ,
306.Xr syslogd 8
307.Pp
308.Pa /usr/share/examples/sliplogin
309.Sh HISTORY
310The
311.Nm
312utility appeared in
313.Bx 4.3 Reno .
314