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