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