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