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