]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/telnet/telnetd/telnetd.8
This commit was generated by cvs2svn to compensate for changes in r58582,
[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. 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 27, 2000
36 .Dt TELNETD 8
37 .Os BSD 4.2
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 BUhlkns
46 .Op Fl D Ar debugmode
47 .Op Fl I Ns Ar initid
48 .Op Fl S Ar tos
49 .Op Fl X Ar authtype
50 .Op Fl a Ar authmode
51 .Op Fl edebug
52 .Op Fl p Ar loginprog
53 .Op Fl r Ns Ar lowpty-highpty
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.  In this mode,
142 .Nm
143 causes login to start a
144 .Xr bftp 1
145 session rather than the user's
146 normal shell.  In bftp daemon mode normal
147 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 Ns .
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 p Ar loginprog
193 Specify an alternate
194 .Xr login 1
195 command to run to complete the login.  The alternate command must
196 understand the same command arguments as the standard login.
197 .It Fl h
198 Disable the printing of host-specific information before
199 login has been completed.
200 .It Fl I Ar initid
201 This option is only applicable to
202 .Tn UNICOS
203 systems prior to 7.0.
204 It specifies the
205 .Dv ID
206 from
207 .Pa /etc/inittab
208 to use when init starts login sessions.  The default
209 .Dv ID
210 is
211 .Dv fe.
212 .It Fl k
213 This option is only useful if
214 .Nm
215 has been compiled with both linemode and kludge linemode
216 support.  If the
217 .Fl k
218 option is specified, then if the remote client does not
219 support the
220 .Dv LINEMODE
221 option, then
222 .Nm
223 will operate in character at a time mode.
224 It will still support kludge linemode, but will only
225 go into kludge linemode if the remote client requests
226 it.
227 (This is done by the client sending
228 .Dv DONT SUPPRESS-GO-AHEAD
229 and
230 .Dv DONT ECHO . )
231 The
232 .Fl k
233 option is most useful when there are remote clients
234 that do not support kludge linemode, but pass the heuristic
235 (if they respond with
236 .Dv WILL TIMING-MARK
237 in response to a
238 .Dv DO TIMING-MARK)
239 for kludge linemode support.
240 .It Fl l
241 Specify line mode. Try to force clients to use line-
242 at-a-time mode.
243 If the
244 .Dv LINEMODE
245 option is not supported, it will go
246 into kludge linemode.
247 .It Fl n
248 Disable
249 .Dv TCP
250 keep-alives.  Normally
251 .Nm
252 enables the
253 .Tn TCP
254 keep-alive mechanism to probe connections that
255 have been idle for some period of time to determine
256 if the client is still there, so that idle connections
257 from machines that have crashed or can no longer
258 be reached may be cleaned up.
259 .It Fl r Ar lowpty-highpty
260 This option is only enabled when
261 .Nm
262 is compiled for
263 .Dv UNICOS.
264 It specifies an inclusive range of pseudo-terminal devices to
265 use.  If the system has sysconf variable
266 .Dv _SC_CRAY_NPTY
267 configured, the default pty search range is 0 to
268 .Dv _SC_CRAY_NPTY;
269 otherwise, the default range is 0 to 128.  Either
270 .Ar lowpty
271 or
272 .Ar highpty
273 may be omitted to allow changing
274 either end of the search range.  If
275 .Ar lowpty
276 is omitted, the - character is still required so that
277 .Nm
278 can differentiate
279 .Ar highpty
280 from
281 .Ar lowpty .
282 .It Fl s
283 This option is only enabled if
284 .Nm
285 is compiled with support for
286 .Tn SecurID
287 cards.
288 It causes the
289 .Fl s
290 option to be passed on to
291 .Xr login 1 ,
292 and thus is only useful if
293 .Xr login 1
294 supports the
295 .Fl s
296 flag to indicate that only
297 .Tn SecurID
298 validated logins are allowed, and is
299 usually useful for controlling remote logins
300 from outside of a firewall.
301 .It Fl S Ar tos
302 .It Fl u Ar len
303 This option is used to specify the size of the field
304 in the
305 .Dv utmp
306 structure that holds the remote host name.
307 If the resolved host name is longer than
308 .Ar len ,
309 the dotted decimal value will be used instead.
310 This allows hosts with very long host names that
311 overflow this field to still be uniquely identified.
312 Specifying
313 .Fl u0
314 indicates that only dotted decimal addresses
315 should be put into the
316 .Pa utmp
317 file.
318 .ne 1i
319 .It Fl U
320 This option causes
321 .Nm
322 to refuse connections from addresses that
323 cannot be mapped back into a symbolic name
324 via the
325 .Xr gethostbyaddr 3
326 routine.
327 .It Fl X Ar authtype
328 This option is only valid if
329 .Nm
330 has been built with support for the authentication option.
331 It disables the use of
332 .Ar authtype
333 authentication, and
334 can be used to temporarily disable
335 a specific authentication type without having to recompile
336 .Nm Ns .
337 .El
338 .Pp
339 .Nm Telnetd
340 operates by allocating a pseudo-terminal device (see
341 .Xr pty 4 )
342 for a client, then creating a login process which has
343 the slave side of the pseudo-terminal as 
344 .Dv stdin ,
345 .Dv stdout
346 and
347 .Dv stderr .
348 .Nm Telnetd
349 manipulates the master side of the pseudo-terminal,
350 implementing the
351 .Tn TELNET
352 protocol and passing characters
353 between the remote client and the login process.
354 .Pp
355 When a
356 .Tn TELNET
357 session is started up, 
358 .Nm
359 sends
360 .Tn TELNET
361 options to the client side indicating
362 a willingness to do the
363 following
364 .Tn TELNET
365 options, which are described in more detail below:
366 .Bd -literal -offset indent
367 DO AUTHENTICATION
368 WILL ENCRYPT
369 DO TERMINAL TYPE
370 DO TSPEED
371 DO XDISPLOC
372 DO NEW-ENVIRON
373 DO ENVIRON
374 WILL SUPPRESS GO AHEAD
375 DO ECHO
376 DO LINEMODE
377 DO NAWS
378 WILL STATUS
379 DO LFLOW
380 DO TIMING-MARK
381 .Ed
382 .Pp
383 The pseudo-terminal allocated to the client is configured
384 to operate in \*(lqcooked\*(rq mode, and with
385 .Dv XTABS and
386 .Dv CRMOD
387 enabled (see
388 .Xr tty 4 ) .
389 .Pp
390 .Nm Telnetd
391 has support for enabling locally the following
392 .Tn TELNET
393 options:
394 .Bl -tag -width "DO AUTHENTICATION"
395 .It "WILL ECHO"
396 When the
397 .Dv LINEMODE
398 option is enabled, a
399 .Dv WILL ECHO
400 or
401 .Dv WONT ECHO
402 will be sent to the client to indicate the
403 current state of terminal echoing.
404 When terminal echo is not desired, a
405 .Dv WILL ECHO
406 is sent to indicate that
407 .Nm
408 will take care of echoing any data that needs to be
409 echoed to the terminal, and then nothing is echoed.
410 When terminal echo is desired, a
411 .Dv WONT ECHO
412 is sent to indicate that
413 .Nm
414 will not be doing any terminal echoing, so the
415 client should do any terminal echoing that is needed.
416 .It "WILL BINARY"
417 Indicate that the client is willing to send a
418 8 bits of data, rather than the normal 7 bits
419 of the Network Virtual Terminal.
420 .It "WILL SGA"
421 Indicate that it will not be sending
422 .Dv IAC GA,
423 go ahead, commands.
424 .It "WILL STATUS"
425 Indicate a willingness to send the client, upon
426 request, of the current status of all
427 .Tn TELNET
428 options.
429 .It "WILL TIMING-MARK"
430 Whenever a
431 .Dv DO TIMING-MARK
432 command is received, it is always responded
433 to with a
434 .Dv WILL TIMING-MARK
435 .ne 1i
436 .It "WILL LOGOUT"
437 When a
438 .Dv DO LOGOUT
439 is received, a
440 .Dv WILL LOGOUT
441 is sent in response, and the
442 .Tn TELNET
443 session is shut down.
444 .It "WILL ENCRYPT"
445 Only sent if
446 .Nm
447 is compiled with support for data encryption, and
448 indicates a willingness to decrypt
449 the data stream.
450 .El
451 .Pp
452 .Nm Telnetd
453 has support for enabling remotely the following
454 .Tn TELNET
455 options:
456 .Bl -tag -width "DO AUTHENTICATION"
457 .It "DO BINARY"
458 Sent to indicate that
459 .Nm
460 is willing to receive an 8 bit data stream.
461 .It "DO LFLOW"
462 Requests that the client handle flow control
463 characters remotely.
464 .It "DO ECHO"
465 This is not really supported, but is sent to identify a 4.2BSD
466 .Xr telnet 1
467 client, which will improperly respond with
468 .Dv WILL ECHO.
469 If a
470 .Dv WILL ECHO
471 is received, a
472 .Dv DONT ECHO
473 will be sent in response.
474 .It "DO TERMINAL-TYPE"
475 Indicate a desire to be able to request the
476 name of the type of terminal that is attached
477 to the client side of the connection.
478 .It "DO SGA"
479 Indicate that it does not need to receive
480 .Dv IAC GA,
481 the go ahead command.
482 .It "DO NAWS"
483 Requests that the client inform the server when
484 the window (display) size changes.
485 .It "DO TERMINAL-SPEED"
486 Indicate a desire to be able to request information
487 about the speed of the serial line to which
488 the client is attached.
489 .It "DO XDISPLOC"
490 Indicate a desire to be able to request the name
491 of the X Window System display that is associated with
492 the telnet client.
493 .It "DO NEW-ENVIRON"
494 Indicate a desire to be able to request environment
495 variable information, as described in RFC 1572.
496 .It "DO ENVIRON"
497 Indicate a desire to be able to request environment
498 variable information, as described in RFC 1408.
499 .It "DO LINEMODE"
500 Only sent if
501 .Nm
502 is compiled with support for linemode, and
503 requests that the client do line by line processing.
504 .It "DO TIMING-MARK"
505 Only sent if
506 .Nm
507 is compiled with support for both linemode and
508 kludge linemode, and the client responded with
509 .Dv WONT LINEMODE.
510 If the client responds with
511 .Dv WILL TM,
512 the it is assumed that the client supports
513 kludge linemode.
514 Note that the
515 .Op Fl k
516 option can be used to disable this.
517 .It "DO AUTHENTICATION"
518 Only sent if
519 .Nm
520 is compiled with support for authentication, and
521 indicates a willingness to receive authentication
522 information for automatic login.
523 .It "DO ENCRYPT"
524 Only sent if
525 .Nm
526 is compiled with support for data encryption, and
527 indicates a willingness to decrypt
528 the data stream.
529 .Sh ENVIRONMENT
530 .Sh FILES
531 .Bl -tag -width /usr/ucb/bftp -compact
532 .It Pa /etc/services
533 .It Pa /etc/inittab
534 (UNICOS systems only)
535 .It Pa /etc/iptos
536 (if supported)
537 .It Pa /usr/ucb/bftp
538 (if supported)
539 .El
540 .Sh "SEE ALSO"
541 .Xr bftp 1 ,
542 .Xr login 1 ,
543 .Xr telnet 1
544 (if supported)
545 .Sh STANDARDS
546 .Bl -tag -compact -width RFC-1572
547 .It Cm RFC-854
548 .Tn TELNET
549 PROTOCOL SPECIFICATION
550 .It Cm RFC-855
551 TELNET OPTION SPECIFICATIONS
552 .It Cm RFC-856
553 TELNET BINARY TRANSMISSION
554 .It Cm RFC-857
555 TELNET ECHO OPTION
556 .It Cm RFC-858
557 TELNET SUPPRESS GO AHEAD OPTION
558 .It Cm RFC-859
559 TELNET STATUS OPTION
560 .It Cm RFC-860
561 TELNET TIMING MARK OPTION
562 .It Cm RFC-861
563 TELNET EXTENDED OPTIONS - LIST OPTION
564 .It Cm RFC-885
565 TELNET END OF RECORD OPTION
566 .It Cm RFC-1073
567 Telnet Window Size Option
568 .It Cm RFC-1079
569 Telnet Terminal Speed Option
570 .It Cm RFC-1091
571 Telnet Terminal-Type Option
572 .It Cm RFC-1096
573 Telnet X Display Location Option
574 .It Cm RFC-1123
575 Requirements for Internet Hosts -- Application and Support
576 .It Cm RFC-1184
577 Telnet Linemode Option
578 .It Cm RFC-1372
579 Telnet Remote Flow Control Option
580 .It Cm RFC-1416
581 Telnet Authentication Option
582 .It Cm RFC-1411
583 Telnet Authentication: Kerberos Version 4
584 .It Cm RFC-1412
585 Telnet Authentication: SPX
586 .It Cm RFC-1571
587 Telnet Environment Option Interoperability Issues
588 .It Cm RFC-1572
589 Telnet Environment Option
590 .Sh BUGS
591 Some
592 .Tn TELNET
593 commands are only partially implemented.
594 .Pp
595 Because of bugs in the original 4.2 BSD
596 .Xr telnet 1 ,
597 .Nm
598 performs some dubious protocol exchanges to try to discover if the remote
599 client is, in fact, a 4.2 BSD
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.
614 .Sh HISTORY
615 IPv6 support was added by WIDE/KAME project.