Release 0.0r
[heimdal.git] / appl / telnet / telnetd / telnetd.8
blobb90a19a910e4d31bac0df4caefd5d95ef4908b58
1 .\" Copyright (c) 1983, 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 .\"     @(#)telnetd.8   8.4 (Berkeley) 6/1/94
33 .\"
34 .Dd June 1, 1994
35 .Dt TELNETD 8
36 .Os BSD 4.2
37 .Sh NAME
38 .Nm telnetd
39 .Nd DARPA
40 .Tn TELNET
41 protocol server
42 .Sh SYNOPSIS
43 .Nm telnetd
44 .Op Fl BUhkln
45 .Op Fl D Ar debugmode
46 .Op Fl S Ar tos
47 .Op Fl X Ar authtype
48 .Op Fl a Ar authmode
49 .Op Fl r Ns Ar lowpty-highpty
50 .Op Fl u Ar len
51 .Op Fl debug
52 .Op Fl L Ar /bin/login
53 .Op Ar port
54 .Sh DESCRIPTION
55 The
56 .Nm telnetd
57 command is a server which supports the
58 .Tn DARPA
59 standard
60 .Tn TELNET
61 virtual terminal protocol.
62 .Nm Telnetd
63 is normally invoked by the internet server (see
64 .Xr inetd 8 )
65 for requests to connect to the
66 .Tn TELNET
67 port as indicated by the
68 .Pa /etc/services
69 file (see
70 .Xr services 5 ) .
71 The
72 .Fl debug
73 option may be used to start up
74 .Nm telnetd
75 manually, instead of through
76 .Xr inetd 8 .
77 If started up this way, 
78 .Ar port
79 may be specified to run
80 .Nm telnetd
81 on an alternate
82 .Tn TCP
83 port number.
84 .Pp
85 The
86 .Nm telnetd
87 command accepts the following options:
88 .Bl -tag -width "-a authmode"
89 .It Fl a Ar authmode
90 This option may be used for specifying what mode should
91 be used for authentication.
92 Note that this option is only useful if
93 .Nm telnetd
94 has been compiled with support for the
95 .Dv AUTHENTICATION
96 option.
97 There are several valid values for
98 .Ar authmode:
99 .Bl -tag -width debug
100 .It debug
101 Turns on authentication debugging code.
102 .It user
103 Only allow connections when the remote user
104 can provide valid authentication information
105 to identify the remote user,
106 and is allowed access to the specified account
107 without providing a password.
108 .It valid
109 Only allow connections when the remote user
110 can provide valid authentication information
111 to identify the remote user.
113 .Xr login 1
114 command will provide any additional user verification
115 needed if the remote user is not allowed automatic
116 access to the specified account.
117 .It other
118 Only allow connections that supply some authentication information.
119 This option is currently not supported
120 by any of the existing authentication mechanisms,
121 and is thus the same as specifying
122 .Fl a
123 .Cm valid .
124 .It none
125 This is the default state.
126 Authentication information is not required.
127 If no or insufficient authentication information
128 is provided, then the
129 .Xr login 1
130 program will provide the necessary user
131 verification.
132 .It off
133 This disables the authentication code.
134 All user verification will happen through the
135 .Xr login 1
136 program.
138 .It Fl B
139 Ignored.
140 .It Fl D Ar debugmode
141 This option may be used for debugging purposes.
142 This allows
143 .Nm telnetd
144 to print out debugging information
145 to the connection, allowing the user to see what
146 .Nm telnetd
147 is doing.
148 There are several possible values for 
149 .Ar debugmode:
150 .Bl -tag -width exercise
151 .It Cm options
152 Prints information about the negotiation of
153 .Tn TELNET
154 options.
155 .It Cm report
156 Prints the 
157 .Cm options
158 information, plus some additional information
159 about what processing is going on.
160 .It Cm netdata
161 Displays the data stream received by
162 .Nm telnetd.
163 .It Cm ptydata
164 Displays data written to the pty.
165 .It Cm exercise
166 Has not been implemented yet.
168 .It Fl h
169 Disables the printing of host-specific information before
170 login has been completed.
171 .It Fl k
172 .It Fl l
173 Ignored.
174 .It Fl n
175 Disable
176 .Dv TCP
177 keep-alives.  Normally
178 .Nm telnetd
179 enables the
180 .Tn TCP
181 keep-alive mechanism to probe connections that
182 have been idle for some period of time to determine
183 if the client is still there, so that idle connections
184 from machines that have crashed or can no longer
185 be reached may be cleaned up.
186 .It Fl r Ar lowpty-highpty
187 This option is only enabled when
188 .Nm telnetd
189 is compiled for
190 .Dv UNICOS.
191 It specifies an inclusive range of pseudo-terminal devices to
192 use.  If the system has sysconf variable
193 .Dv _SC_CRAY_NPTY
194 configured, the default pty search range is 0 to
195 .Dv _SC_CRAY_NPTY;
196 otherwise, the default range is 0 to 128.  Either
197 .Ar lowpty
199 .Ar highpty
200 may be omitted to allow changing
201 either end of the search range.  If
202 .Ar lowpty
203 is omitted, the - character is still required so that
204 .Nm telnetd
205 can differentiate
206 .Ar highpty
207 from
208 .Ar lowpty .
209 .It Fl S Ar tos
210 .It Fl u Ar len
211 This option is used to specify the size of the field
212 in the
213 .Dv utmp
214 structure that holds the remote host name.
215 If the resolved host name is longer than
216 .Ar len ,
217 the dotted decimal value will be used instead.
218 This allows hosts with very long host names that
219 overflow this field to still be uniquely identified.
220 Specifying
221 .Fl u0
222 indicates that only dotted decimal addresses
223 should be put into the
224 .Pa utmp
225 file.
226 .ne 1i
227 .It Fl U
228 This option causes
229 .Nm telnetd
230 to refuse connections from addresses that
231 cannot be mapped back into a symbolic name
232 via the
233 .Xr gethostbyaddr 3
234 routine.
235 .It Fl X Ar authtype
236 This option is only valid if
237 .Nm telnetd
238 has been built with support for the authentication option.
239 It disables the use of
240 .Ar authtype
241 authentication, and
242 can be used to temporarily disable
243 a specific authentication type without having to recompile
244 .Nm telnetd .
245 .It Fl L pathname
246 Specify pathname to an alternative login program.
249 .Nm Telnetd
250 operates by allocating a pseudo-terminal device (see
251 .Xr pty 4 )
252 for a client, then creating a login process which has
253 the slave side of the pseudo-terminal as 
254 .Dv stdin ,
255 .Dv stdout
257 .Dv stderr .
258 .Nm Telnetd
259 manipulates the master side of the pseudo-terminal,
260 implementing the
261 .Tn TELNET
262 protocol and passing characters
263 between the remote client and the login process.
265 When a
266 .Tn TELNET
267 session is started up, 
268 .Nm telnetd
269 sends
270 .Tn TELNET
271 options to the client side indicating
272 a willingness to do the
273 following
274 .Tn TELNET
275 options, which are described in more detail below:
276 .Bd -literal -offset indent
277 DO AUTHENTICATION
278 WILL ENCRYPT
279 DO TERMINAL TYPE
280 DO TSPEED
281 DO XDISPLOC
282 DO NEW-ENVIRON
283 DO ENVIRON
284 WILL SUPPRESS GO AHEAD
285 DO ECHO
286 DO LINEMODE
287 DO NAWS
288 WILL STATUS
289 DO LFLOW
290 DO TIMING-MARK
293 The pseudo-terminal allocated to the client is configured
294 to operate in \*(lqcooked\*(rq mode, and with
295 .Dv XTABS and
296 .Dv CRMOD
297 enabled (see
298 .Xr tty 4 ) .
300 .Nm Telnetd
301 has support for enabling locally the following
302 .Tn TELNET
303 options:
304 .Bl -tag -width "DO AUTHENTICATION"
305 .It "WILL ECHO"
306 When the
307 .Dv LINEMODE
308 option is enabled, a
309 .Dv WILL ECHO
311 .Dv WONT ECHO
312 will be sent to the client to indicate the
313 current state of terminal echoing.
314 When terminal echo is not desired, a
315 .Dv WILL ECHO
316 is sent to indicate that
317 .Tn telnetd
318 will take care of echoing any data that needs to be
319 echoed to the terminal, and then nothing is echoed.
320 When terminal echo is desired, a
321 .Dv WONT ECHO
322 is sent to indicate that
323 .Tn telnetd
324 will not be doing any terminal echoing, so the
325 client should do any terminal echoing that is needed.
326 .It "WILL BINARY"
327 Indicates that the client is willing to send a
328 8 bits of data, rather than the normal 7 bits
329 of the Network Virtual Terminal.
330 .It "WILL SGA"
331 Indicates that it will not be sending
332 .Dv IAC GA,
333 go ahead, commands.
334 .It "WILL STATUS"
335 Indicates a willingness to send the client, upon
336 request, of the current status of all
337 .Tn TELNET
338 options.
339 .It "WILL TIMING-MARK"
340 Whenever a
341 .Dv DO TIMING-MARK
342 command is received, it is always responded
343 to with a
344 .Dv WILL TIMING-MARK
345 .ne 1i
346 .It "WILL LOGOUT"
347 When a
348 .Dv DO LOGOUT
349 is received, a
350 .Dv WILL LOGOUT
351 is sent in response, and the
352 .Tn TELNET
353 session is shut down.
354 .It "WILL ENCRYPT"
355 Only sent if
356 .Nm telnetd
357 is compiled with support for data encryption, and
358 indicates a willingness to decrypt
359 the data stream.
362 .Nm Telnetd
363 has support for enabling remotely the following
364 .Tn TELNET
365 options:
366 .Bl -tag -width "DO AUTHENTICATION"
367 .It "DO BINARY"
368 Sent to indicate that
369 .Tn telnetd
370 is willing to receive an 8 bit data stream.
371 .It "DO LFLOW"
372 Requests that the client handle flow control
373 characters remotely.
374 .It "DO ECHO"
375 This is not really supported, but is sent to identify a 4.2BSD
376 .Xr telnet 1
377 client, which will improperly respond with
378 .Dv WILL ECHO.
379 If a
380 .Dv WILL ECHO
381 is received, a
382 .Dv DONT ECHO
383 will be sent in response.
384 .It "DO TERMINAL-TYPE"
385 Indicates a desire to be able to request the
386 name of the type of terminal that is attached
387 to the client side of the connection.
388 .It "DO SGA"
389 Indicates that it does not need to receive
390 .Dv IAC GA,
391 the go ahead command.
392 .It "DO NAWS"
393 Requests that the client inform the server when
394 the window (display) size changes.
395 .It "DO TERMINAL-SPEED"
396 Indicates a desire to be able to request information
397 about the speed of the serial line to which
398 the client is attached.
399 .It "DO XDISPLOC"
400 Indicates a desire to be able to request the name
401 of the X windows display that is associated with
402 the telnet client.
403 .It "DO NEW-ENVIRON"
404 Indicates a desire to be able to request environment
405 variable information, as described in RFC 1572.
406 .It "DO ENVIRON"
407 Indicates a desire to be able to request environment
408 variable information, as described in RFC 1408.
409 .It "DO LINEMODE"
410 Only sent if
411 .Nm telnetd
412 is compiled with support for linemode, and
413 requests that the client do line by line processing.
414 .It "DO TIMING-MARK"
415 Only sent if
416 .Nm telnetd
417 is compiled with support for both linemode and
418 kludge linemode, and the client responded with
419 .Dv WONT LINEMODE.
420 If the client responds with
421 .Dv WILL TM,
422 the it is assumed that the client supports
423 kludge linemode.
424 Note that the
425 .Op Fl k
426 option can be used to disable this.
427 .It "DO AUTHENTICATION"
428 Only sent if
429 .Nm telnetd
430 is compiled with support for authentication, and
431 indicates a willingness to receive authentication
432 information for automatic login.
433 .It "DO ENCRYPT"
434 Only sent if
435 .Nm telnetd
436 is compiled with support for data encryption, and
437 indicates a willingness to decrypt
438 the data stream.
439 .Sh ENVIRONMENT
440 .Sh FILES
441 .Pa /etc/services
443 .Pa /etc/inittab
444 (UNICOS systems only)
446 .Pa /etc/iptos
447 (if supported)
449 .Sh "SEE ALSO"
450 .Xr telnet 1 ,
451 .Xr login 1
452 .Sh STANDARDS
453 .Bl -tag -compact -width RFC-1572
454 .It Cm RFC-854
455 .Tn TELNET
456 PROTOCOL SPECIFICATION
457 .It Cm RFC-855
458 TELNET OPTION SPECIFICATIONS
459 .It Cm RFC-856
460 TELNET BINARY TRANSMISSION
461 .It Cm RFC-857
462 TELNET ECHO OPTION
463 .It Cm RFC-858
464 TELNET SUPPRESS GO AHEAD OPTION
465 .It Cm RFC-859
466 TELNET STATUS OPTION
467 .It Cm RFC-860
468 TELNET TIMING MARK OPTION
469 .It Cm RFC-861
470 TELNET EXTENDED OPTIONS - LIST OPTION
471 .It Cm RFC-885
472 TELNET END OF RECORD OPTION
473 .It Cm RFC-1073
474 Telnet Window Size Option
475 .It Cm RFC-1079
476 Telnet Terminal Speed Option
477 .It Cm RFC-1091
478 Telnet Terminal-Type Option
479 .It Cm RFC-1096
480 Telnet X Display Location Option
481 .It Cm RFC-1123
482 Requirements for Internet Hosts -- Application and Support
483 .It Cm RFC-1184
484 Telnet Linemode Option
485 .It Cm RFC-1372
486 Telnet Remote Flow Control Option
487 .It Cm RFC-1416
488 Telnet Authentication Option
489 .It Cm RFC-1411
490 Telnet Authentication: Kerberos Version 4
491 .It Cm RFC-1412
492 Telnet Authentication: SPX
493 .It Cm RFC-1571
494 Telnet Environment Option Interoperability Issues
495 .It Cm RFC-1572
496 Telnet Environment Option
497 .Sh BUGS
498 Some
499 .Tn TELNET
500 commands are only partially implemented.
502 Because of bugs in the original 4.2 BSD
503 .Xr telnet 1 ,
504 .Nm telnetd
505 performs some dubious protocol exchanges to try to discover if the remote
506 client is, in fact, a 4.2 BSD
507 .Xr telnet 1 .
509 Binary mode
510 has no common interpretation except between similar operating systems
511 (Unix in this case).
513 The terminal type name received from the remote client is converted to
514 lower case.
516 .Nm Telnetd
517 never sends
518 .Tn TELNET
519 .Dv IAC GA
520 (go ahead) commands.