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