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