Initial import from FreeBSD RELENG_4:
[dragonfly.git] / crypto / telnet / telnetd / 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 .\" $FreeBSD: src/crypto/telnet/telnetd/telnetd.8,v 1.5.2.6 2002/04/13 10:59:09 markm Exp $
34 .\"
35 .Dd January 27, 2000
36 .Dt TELNETD 8
37 .Os
38 .Sh NAME
39 .Nm telnetd
40 .Nd DARPA
41 .Tn TELNET
42 protocol server
43 .Sh SYNOPSIS
44 .Nm /usr/libexec/telnetd
45 .Op Fl BUhlkn
46 .Op Fl D Ar debugmode
47 .Op Fl S Ar tos
48 .Op Fl X Ar authtype
49 .Op Fl a Ar authmode
50 .Op Fl edebug
51 .Op Fl p Ar loginprog
52 .Op Fl u Ar len
53 .Op Fl debug Op Ar port
54 .Sh DESCRIPTION
55 The
56 .Nm
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
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
81 on an alternate
82 .Tn TCP
83 port number.
84 .Pp
85 The
86 .Nm
87 command accepts the following options:
88 .Bl -tag -width indent
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
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 Cm debug
101 Turn on authentication debugging code.
102 .It Cm 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 Cm 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 Cm 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 Cm 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 Cm off
133 Disable the authentication code.
134 All user verification will happen through the
135 .Xr login 1
136 program.
137 .El
138 .It Fl B
139 Specify bftp server mode.  In this mode,
140 .Nm
141 causes login to start a
142 .Xr bftp 1
143 session rather than the user's
144 normal shell.  In bftp daemon mode normal
145 logins are not supported, and it must be used
146 on a port other than the normal
147 .Tn TELNET
148 port.
149 .It Fl D Ar debugmode
150 This option may be used for debugging purposes.
151 This allows
152 .Nm
153 to print out debugging information
154 to the connection, allowing the user to see what
155 .Nm
156 is doing.
157 There are several possible values for
158 .Ar debugmode :
159 .Bl -tag -width exercise
160 .It Cm options
161 Print information about the negotiation of
162 .Tn TELNET
163 options.
164 .It Cm report
165 Print the
166 .Cm options
167 information, plus some additional information
168 about what processing is going on.
169 .It Cm netdata
170 Display the data stream received by
171 .Nm .
172 .It Cm ptydata
173 Display data written to the pty.
174 .It Cm exercise
175 Has not been implemented yet.
176 .El
177 .It Fl debug
178 Enable debugging on each socket created by
179 .Nm
180 (see
181 .Dv SO_DEBUG
182 in
183 .Xr socket 2 ) .
184 .It Fl edebug
185 If
186 .Nm
187 has been compiled with support for data encryption, then the
188 .Fl edebug
189 option may be used to enable encryption debugging code.
190 .It Fl h
191 Disable the printing of host-specific information before
192 login has been completed.
193 .It Fl k
194 This option is only useful if
195 .Nm
196 has been compiled with both linemode and kludge linemode
197 support.  If the
198 .Fl k
199 option is specified, then if the remote client does not
200 support the
201 .Dv LINEMODE
202 option, then
203 .Nm
204 will operate in character at a time mode.
205 It will still support kludge linemode, but will only
206 go into kludge linemode if the remote client requests
207 it.
208 (This is done by the client sending
209 .Dv DONT SUPPRESS-GO-AHEAD
210 and
211 .Dv DONT ECHO . )
212 The
213 .Fl k
214 option is most useful when there are remote clients
215 that do not support kludge linemode, but pass the heuristic
216 (if they respond with
217 .Dv WILL TIMING-MARK
218 in response to a
219 .Dv DO TIMING-MARK )
220 for kludge linemode support.
221 .It Fl l
222 Specify line mode. Try to force clients to use line-
223 at-a-time mode.
224 If the
225 .Dv LINEMODE
226 option is not supported, it will go
227 into kludge linemode.
228 .It Fl n
229 Disable
230 .Dv TCP
231 keep-alives.  Normally
232 .Nm
233 enables the
234 .Tn TCP
235 keep-alive mechanism to probe connections that
236 have been idle for some period of time to determine
237 if the client is still there, so that idle connections
238 from machines that have crashed or can no longer
239 be reached may be cleaned up.
240 .It Fl p Ar loginprog
241 Specify an alternate
242 .Xr login 1
243 command to run to complete the login.  The alternate command must
244 understand the same command arguments as the standard login.
245 .It Fl S Ar tos
246 .It Fl u Ar len
247 This option is used to specify the size of the field
248 in the
249 .Dv utmp
250 structure that holds the remote host name.
251 If the resolved host name is longer than
252 .Ar len ,
253 the dotted decimal value will be used instead.
254 This allows hosts with very long host names that
255 overflow this field to still be uniquely identified.
256 Specifying
257 .Fl u0
258 indicates that only dotted decimal addresses
259 should be put into the
260 .Pa utmp
261 file.
262 .It Fl U
263 This option causes
264 .Nm
265 to refuse connections from addresses that
266 cannot be mapped back into a symbolic name
267 via the
268 .Xr gethostbyaddr 3
269 routine.
270 .It Fl X Ar authtype
271 This option is only valid if
272 .Nm
273 has been built with support for the authentication option.
274 It disables the use of
275 .Ar authtype
276 authentication, and
277 can be used to temporarily disable
278 a specific authentication type without having to recompile
279 .Nm .
280 .El
281 .Pp
282 .Nm Telnetd
283 operates by allocating a pseudo-terminal device (see
284 .Xr pty 4 )
285 for a client, then creating a login process which has
286 the slave side of the pseudo-terminal as
287 .Dv stdin ,
288 .Dv stdout
289 and
290 .Dv stderr .
291 .Nm Telnetd
292 manipulates the master side of the pseudo-terminal,
293 implementing the
294 .Tn TELNET
295 protocol and passing characters
296 between the remote client and the login process.
297 .Pp
298 When a
299 .Tn TELNET
300 session is started up,
301 .Nm
302 sends
303 .Tn TELNET
304 options to the client side indicating
305 a willingness to do the
306 following
307 .Tn TELNET
308 options, which are described in more detail below:
309 .Bd -literal -offset indent
310 DO AUTHENTICATION
311 WILL ENCRYPT
312 DO TERMINAL TYPE
313 DO TSPEED
314 DO XDISPLOC
315 DO NEW-ENVIRON
316 DO ENVIRON
317 WILL SUPPRESS GO AHEAD
318 DO ECHO
319 DO LINEMODE
320 DO NAWS
321 WILL STATUS
322 DO LFLOW
323 DO TIMING-MARK
324 .Ed
325 .Pp
326 The pseudo-terminal allocated to the client is configured
327 to operate in
328 .Dq cooked
329 mode, and with
330 .Dv XTABS and
331 .Dv CRMOD
332 enabled (see
333 .Xr tty 4 ) .
334 .Pp
335 .Nm Telnetd
336 has support for enabling locally the following
337 .Tn TELNET
338 options:
339 .Bl -tag -width "DO AUTHENTICATION"
340 .It "WILL ECHO"
341 When the
342 .Dv LINEMODE
343 option is enabled, a
344 .Dv WILL ECHO
345 or
346 .Dv WONT ECHO
347 will be sent to the client to indicate the
348 current state of terminal echoing.
349 When terminal echo is not desired, a
350 .Dv WILL ECHO
351 is sent to indicate that
352 .Nm
353 will take care of echoing any data that needs to be
354 echoed to the terminal, and then nothing is echoed.
355 When terminal echo is desired, a
356 .Dv WONT ECHO
357 is sent to indicate that
358 .Nm
359 will not be doing any terminal echoing, so the
360 client should do any terminal echoing that is needed.
361 .It "WILL BINARY"
362 Indicate that the client is willing to send a
363 8 bits of data, rather than the normal 7 bits
364 of the Network Virtual Terminal.
365 .It "WILL SGA"
366 Indicate that it will not be sending
367 .Dv IAC GA ,
368 go ahead, commands.
369 .It "WILL STATUS"
370 Indicate a willingness to send the client, upon
371 request, of the current status of all
372 .Tn TELNET
373 options.
374 .It "WILL TIMING-MARK"
375 Whenever a
376 .Dv DO TIMING-MARK
377 command is received, it is always responded
378 to with a
379 .Dv WILL TIMING-MARK .
380 .It "WILL LOGOUT"
381 When a
382 .Dv DO LOGOUT
383 is received, a
384 .Dv WILL LOGOUT
385 is sent in response, and the
386 .Tn TELNET
387 session is shut down.
388 .It "WILL ENCRYPT"
389 Only sent if
390 .Nm
391 is compiled with support for data encryption, and
392 indicates a willingness to decrypt
393 the data stream.
394 .El
395 .Pp
396 .Nm Telnetd
397 has support for enabling remotely the following
398 .Tn TELNET
399 options:
400 .Bl -tag -width "DO AUTHENTICATION"
401 .It "DO BINARY"
402 Sent to indicate that
403 .Nm
404 is willing to receive an 8 bit data stream.
405 .It "DO LFLOW"
406 Requests that the client handle flow control
407 characters remotely.
408 .It "DO ECHO"
409 This is not really supported, but is sent to identify a
410 .Bx 4.2
411 .Xr telnet 1
412 client, which will improperly respond with
413 .Dv WILL ECHO .
414 If a
415 .Dv WILL ECHO
416 is received, a
417 .Dv DONT ECHO
418 will be sent in response.
419 .It "DO TERMINAL-TYPE"
420 Indicate a desire to be able to request the
421 name of the type of terminal that is attached
422 to the client side of the connection.
423 .It "DO SGA"
424 Indicate that it does not need to receive
425 .Dv IAC GA ,
426 the go ahead command.
427 .It "DO NAWS"
428 Requests that the client inform the server when
429 the window (display) size changes.
430 .It "DO TERMINAL-SPEED"
431 Indicate a desire to be able to request information
432 about the speed of the serial line to which
433 the client is attached.
434 .It "DO XDISPLOC"
435 Indicate a desire to be able to request the name
436 of the X Window System display that is associated with
437 the telnet client.
438 .It "DO NEW-ENVIRON"
439 Indicate a desire to be able to request environment
440 variable information, as described in RFC 1572.
441 .It "DO ENVIRON"
442 Indicate a desire to be able to request environment
443 variable information, as described in RFC 1408.
444 .It "DO LINEMODE"
445 Only sent if
446 .Nm
447 is compiled with support for linemode, and
448 requests that the client do line by line processing.
449 .It "DO TIMING-MARK"
450 Only sent if
451 .Nm
452 is compiled with support for both linemode and
453 kludge linemode, and the client responded with
454 .Dv WONT LINEMODE .
455 If the client responds with
456 .Dv WILL TM ,
457 the it is assumed that the client supports
458 kludge linemode.
459 Note that the
460 .Op Fl k
461 option can be used to disable this.
462 .It "DO AUTHENTICATION"
463 Only sent if
464 .Nm
465 is compiled with support for authentication, and
466 indicates a willingness to receive authentication
467 information for automatic login.
468 .It "DO ENCRYPT"
469 Only sent if
470 .Nm
471 is compiled with support for data encryption, and
472 indicates a willingness to decrypt
473 the data stream.
474 .El
475 .Sh NOTES
476 By default
477 .Nm
478 will read the
479 .Em \&he ,
480 .Em \&hn ,
481 and
482 .Em \&im
483 capabilities from
484 .Pa /etc/gettytab
485 and use that information (if present) to determine
486 what to display before the login: prompt. You can
487 also use a System V style
488 .Pa /etc/issue
489 file by using the
490 .Em \&if
491 capability, which will override
492 .Em \&im .
493 The information specified in either
494 .Em \&im
495 or
496 .Em \&if
497 will be displayed to both console and remote logins.
498 .\" .Sh ENVIRONMENT
499 .Sh FILES
500 .Bl -tag -width /usr/ucb/bftp -compact
501 .It Pa /etc/services
502 .It Pa /etc/gettytab
503 .It Pa /etc/iptos
504 (if supported)
505 .It Pa /usr/ucb/bftp
506 (if supported)
507 .El
508 .Sh "SEE ALSO"
509 .Xr bftp 1 ,
510 .Xr login 1 ,
511 .Xr gettytab 5 ,
512 .Xr telnet 1
513 (if supported)
514 .Sh STANDARDS
515 .Bl -tag -compact -width RFC-1572
516 .It Cm RFC-854
517 .Tn TELNET
518 PROTOCOL SPECIFICATION
519 .It Cm RFC-855
520 TELNET OPTION SPECIFICATIONS
521 .It Cm RFC-856
522 TELNET BINARY TRANSMISSION
523 .It Cm RFC-857
524 TELNET ECHO OPTION
525 .It Cm RFC-858
526 TELNET SUPPRESS GO AHEAD OPTION
527 .It Cm RFC-859
528 TELNET STATUS OPTION
529 .It Cm RFC-860
530 TELNET TIMING MARK OPTION
531 .It Cm RFC-861
532 TELNET EXTENDED OPTIONS - LIST OPTION
533 .It Cm RFC-885
534 TELNET END OF RECORD OPTION
535 .It Cm RFC-1073
536 Telnet Window Size Option
537 .It Cm RFC-1079
538 Telnet Terminal Speed Option
539 .It Cm RFC-1091
540 Telnet Terminal-Type Option
541 .It Cm RFC-1096
542 Telnet X Display Location Option
543 .It Cm RFC-1123
544 Requirements for Internet Hosts -- Application and Support
545 .It Cm RFC-1184
546 Telnet Linemode Option
547 .It Cm RFC-1372
548 Telnet Remote Flow Control Option
549 .It Cm RFC-1416
550 Telnet Authentication Option
551 .It Cm RFC-1411
552 Telnet Authentication: Kerberos Version 4
553 .It Cm RFC-1412
554 Telnet Authentication: SPX
555 .It Cm RFC-1571
556 Telnet Environment Option Interoperability Issues
557 .It Cm RFC-1572
558 Telnet Environment Option
559 .El
560 .Sh BUGS
561 Some
562 .Tn TELNET
563 commands are only partially implemented.
564 .Pp
565 Because of bugs in the original
566 .Bx 4.2
567 .Xr telnet 1 ,
568 .Nm
569 performs some dubious protocol exchanges to try to discover if the remote
570 client is, in fact, a
571 .Bx 4.2
572 .Xr telnet 1 .
573 .Pp
574 Binary mode
575 has no common interpretation except between similar operating systems
576 (Unix in this case).
577 .Pp
578 The terminal type name received from the remote client is converted to
579 lower case.
580 .Pp
581 .Nm Telnetd
582 never sends
583 .Tn TELNET
584 .Dv IAC GA
585 (go ahead) commands.
586 .Sh HISTORY
587 IPv6 support was added by WIDE/KAME project.