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