]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/telnet/telnetd/telnetd.8
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.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 January 9, 2005
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 .El
301 .Pp
302 .Nm Telnetd
303 operates by allocating a pseudo-terminal device (see
304 .Xr pty 4 )
305 for a client, then creating a login process which has
306 the slave side of the pseudo-terminal as
307 .Dv stdin ,
308 .Dv stdout
309 and
310 .Dv stderr .
311 .Nm Telnetd
312 manipulates the master side of the pseudo-terminal,
313 implementing the
314 .Tn TELNET
315 protocol and passing characters
316 between the remote client and the login process.
317 .Pp
318 When a
319 .Tn TELNET
320 session is started up,
321 .Nm
322 sends
323 .Tn TELNET
324 options to the client side indicating
325 a willingness to do the
326 following
327 .Tn TELNET
328 options, which are described in more detail below:
329 .Bd -literal -offset indent
330 DO AUTHENTICATION
331 WILL ENCRYPT
332 DO TERMINAL TYPE
333 DO TSPEED
334 DO XDISPLOC
335 DO NEW-ENVIRON
336 DO ENVIRON
337 WILL SUPPRESS GO AHEAD
338 DO ECHO
339 DO LINEMODE
340 DO NAWS
341 WILL STATUS
342 DO LFLOW
343 DO TIMING-MARK
344 .Ed
345 .Pp
346 The pseudo-terminal allocated to the client is configured
347 to operate in
348 .Dq cooked
349 mode, and with
350 .Dv XTABS and
351 .Dv CRMOD
352 enabled (see
353 .Xr tty 4 ) .
354 .Pp
355 .Nm Telnetd
356 has support for enabling locally the following
357 .Tn TELNET
358 options:
359 .Bl -tag -width "DO AUTHENTICATION"
360 .It "WILL ECHO"
361 When the
362 .Dv LINEMODE
363 option is enabled, a
364 .Dv WILL ECHO
365 or
366 .Dv WONT ECHO
367 will be sent to the client to indicate the
368 current state of terminal echoing.
369 When terminal echo is not desired, a
370 .Dv WILL ECHO
371 is sent to indicate that
372 .Nm
373 will take care of echoing any data that needs to be
374 echoed to the terminal, and then nothing is echoed.
375 When terminal echo is desired, a
376 .Dv WONT ECHO
377 is sent to indicate that
378 .Nm
379 will not be doing any terminal echoing, so the
380 client should do any terminal echoing that is needed.
381 .It "WILL BINARY"
382 Indicate that the client is willing to send a
383 8 bits of data, rather than the normal 7 bits
384 of the Network Virtual Terminal.
385 .It "WILL SGA"
386 Indicate that it will not be sending
387 .Dv IAC GA ,
388 go ahead, commands.
389 .It "WILL STATUS"
390 Indicate a willingness to send the client, upon
391 request, of the current status of all
392 .Tn TELNET
393 options.
394 .It "WILL TIMING-MARK"
395 Whenever a
396 .Dv DO TIMING-MARK
397 command is received, it is always responded
398 to with a
399 .Dv WILL TIMING-MARK .
400 .It "WILL LOGOUT"
401 When a
402 .Dv DO LOGOUT
403 is received, a
404 .Dv WILL LOGOUT
405 is sent in response, and the
406 .Tn TELNET
407 session is shut down.
408 .It "WILL ENCRYPT"
409 Only sent if
410 .Nm
411 is compiled with support for data encryption, and
412 indicates a willingness to decrypt
413 the data stream.
414 .El
415 .Pp
416 .Nm Telnetd
417 has support for enabling remotely the following
418 .Tn TELNET
419 options:
420 .Bl -tag -width "DO AUTHENTICATION"
421 .It "DO BINARY"
422 Sent to indicate that
423 .Nm
424 is willing to receive an 8 bit data stream.
425 .It "DO LFLOW"
426 Requests that the client handle flow control
427 characters remotely.
428 .It "DO ECHO"
429 This is not really supported, but is sent to identify a
430 .Bx 4.2
431 .Xr telnet 1
432 client, which will improperly respond with
433 .Dv WILL ECHO .
434 If a
435 .Dv WILL ECHO
436 is received, a
437 .Dv DONT ECHO
438 will be sent in response.
439 .It "DO TERMINAL-TYPE"
440 Indicate a desire to be able to request the
441 name of the type of terminal that is attached
442 to the client side of the connection.
443 .It "DO SGA"
444 Indicate that it does not need to receive
445 .Dv IAC GA ,
446 the go ahead command.
447 .It "DO NAWS"
448 Requests that the client inform the server when
449 the window (display) size changes.
450 .It "DO TERMINAL-SPEED"
451 Indicate a desire to be able to request information
452 about the speed of the serial line to which
453 the client is attached.
454 .It "DO XDISPLOC"
455 Indicate a desire to be able to request the name
456 of the X Window System display that is associated with
457 the telnet client.
458 .It "DO NEW-ENVIRON"
459 Indicate a desire to be able to request environment
460 variable information, as described in RFC 1572.
461 .It "DO ENVIRON"
462 Indicate a desire to be able to request environment
463 variable information, as described in RFC 1408.
464 .It "DO LINEMODE"
465 Only sent if
466 .Nm
467 is compiled with support for linemode, and
468 requests that the client do line by line processing.
469 .It "DO TIMING-MARK"
470 Only sent if
471 .Nm
472 is compiled with support for both linemode and
473 kludge linemode, and the client responded with
474 .Dv WONT LINEMODE .
475 If the client responds with
476 .Dv WILL TM ,
477 the it is assumed that the client supports
478 kludge linemode.
479 Note that the
480 .Op Fl k
481 option can be used to disable this.
482 .It "DO AUTHENTICATION"
483 Only sent if
484 .Nm
485 is compiled with support for authentication, and
486 indicates a willingness to receive authentication
487 information for automatic login.
488 .It "DO ENCRYPT"
489 Only sent if
490 .Nm
491 is compiled with support for data encryption, and
492 indicates a willingness to decrypt
493 the data stream.
494 .El
495 .Sh NOTES
496 By default
497 .Nm
498 will read the
499 .Em \&he ,
500 .Em \&hn ,
501 and
502 .Em \&im
503 capabilities from
504 .Pa /etc/gettytab
505 and use that information (if present) to determine
506 what to display before the login: prompt.
507 You can
508 also use a System V style
509 .Pa /etc/issue
510 file by using the
511 .Em \&if
512 capability, which will override
513 .Em \&im .
514 The information specified in either
515 .Em \&im
516 or
517 .Em \&if
518 will be displayed to both console and remote logins.
519 .\" .Sh ENVIRONMENT
520 .Sh FILES
521 .Bl -tag -width /usr/ucb/bftp -compact
522 .It Pa /etc/services
523 .It Pa /etc/gettytab
524 .It Pa /etc/iptos
525 (if supported)
526 .It Pa /usr/ucb/bftp
527 (if supported)
528 .El
529 .Sh "SEE ALSO"
530 .Xr bftp 1 ,
531 .Xr login 1 ,
532 .Xr telnet 1
533 (if supported),
534 .Xr gettytab 5
535 .Sh STANDARDS
536 .Bl -tag -compact -width RFC-1572
537 .It Cm RFC-854
538 .Tn TELNET
539 PROTOCOL SPECIFICATION
540 .It Cm RFC-855
541 TELNET OPTION SPECIFICATIONS
542 .It Cm RFC-856
543 TELNET BINARY TRANSMISSION
544 .It Cm RFC-857
545 TELNET ECHO OPTION
546 .It Cm RFC-858
547 TELNET SUPPRESS GO AHEAD OPTION
548 .It Cm RFC-859
549 TELNET STATUS OPTION
550 .It Cm RFC-860
551 TELNET TIMING MARK OPTION
552 .It Cm RFC-861
553 TELNET EXTENDED OPTIONS - LIST OPTION
554 .It Cm RFC-885
555 TELNET END OF RECORD OPTION
556 .It Cm RFC-1073
557 Telnet Window Size Option
558 .It Cm RFC-1079
559 Telnet Terminal Speed Option
560 .It Cm RFC-1091
561 Telnet Terminal-Type Option
562 .It Cm RFC-1096
563 Telnet X Display Location Option
564 .It Cm RFC-1123
565 Requirements for Internet Hosts -- Application and Support
566 .It Cm RFC-1184
567 Telnet Linemode Option
568 .It Cm RFC-1372
569 Telnet Remote Flow Control Option
570 .It Cm RFC-1416
571 Telnet Authentication Option
572 .It Cm RFC-1411
573 Telnet Authentication: Kerberos Version 4
574 .It Cm RFC-1412
575 Telnet Authentication: SPX
576 .It Cm RFC-1571
577 Telnet Environment Option Interoperability Issues
578 .It Cm RFC-1572
579 Telnet Environment Option
580 .El
581 .Sh HISTORY
582 IPv6 support was added by WIDE/KAME project.
583 .Sh BUGS
584 Some
585 .Tn TELNET
586 commands are only partially implemented.
587 .Pp
588 Because of bugs in the original
589 .Bx 4.2
590 .Xr telnet 1 ,
591 .Nm
592 performs some dubious protocol exchanges to try to discover if the remote
593 client is, in fact, a
594 .Bx 4.2
595 .Xr telnet 1 .
596 .Pp
597 Binary mode
598 has no common interpretation except between similar operating systems
599 (Unix in this case).
600 .Pp
601 The terminal type name received from the remote client is converted to
602 lower case.
603 .Pp
604 .Nm Telnetd
605 never sends
606 .Tn TELNET
607 .Dv IAC GA
608 (go ahead) commands.