Debian Codegraph @

upstream/debian-unstable/man8/in.telnetd.8

raw
1 .\" Copyright (c) 1983 The Regents of the University of California.
2 .\" 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 .\" from: @(#)telnetd.8 6.8 (Berkeley) 4/20/91
33 .\" $Id: telnetd.8,v 1.5 2006-09-24 00:48:31 ianb Exp $
34 .\"
35 .Dd December 29, 1996
36 .Dt TELNETD 8
37 .Os "Linux NetKit (0.17)"
38 .Sh NAME
39 .Nm telnetd
40 .Nd DARPA
41 .Tn telnet
42 protocol server
43 .Sh SYNOPSIS
44 .Nm /usr/sbin/in.telnetd
45 .Op Fl hnNs
46 .Op Fl a Ar authmode
47 .Op Fl D Ar debugmode
48 .Op Fl L Ar loginprg
49 .Op Fl S Ar tos
50 .Op Fl X Ar authtype
51 .Op Fl edebug
52 .Op Fl debug Ar port
53 .Op Fl z Ar sslopt
54 .Sh DESCRIPTION
55 The
56 .Nm telnetd
57 program is a server which supports the
58 .Tn DARPA
59 .Tn telnet
60 interactive communication protocol.
61 .Nm Telnetd
62 is normally invoked by the internet server (see
63 .Xr inetd 8 )
64 for requests to connect to the
65 .Tn telnet
66 port as indicated by the
67 .Pa /etc/services
68 file (see
69 .Xr services 5 ) .
70 The
71 .Fl debug
72 option may be used to start up
73 .Nm telnetd
74 manually, instead of through
75 .Xr inetd 8 .
76 If started up this way,
77 .Ar port
78 may be specified to run
79 .Nm telnetd
80 on an alternate
81 .Tn TCP
82 port number.
83 .Pp
84 The
85 .Nm telnetd
86 program accepts the following options:
87 .Bl -tag -width "-a authmode"
88 .It Fl a Ar authmode
89 This option may be used for specifying what mode should
90 be used for authentication.
91 Note that this option is only useful if
92 .Nm telnetd
93 has been compiled with support for authentication, which is not
94 available in the current version. The following values of
95 .Ar authmode
96 are understood:
97 .Bl -tag -width debug
98 .It debug
99 Turns on authentication debugging code.
100 .It user
101 Only allow connections when the remote user can provide valid
102 authentication information to identify the remote user, and is allowed
103 access to the specified account without providing a password.
104 .It valid
105 Only allow connections when the remote user can provide valid
106 authentication information to identify the remote user. The
107 .Xr login 1
108 command will provide any additional user verification needed if the
109 remote user is not allowed automatic access to the specified account.
110 .It other
111 Only allow connections that supply some authentication information.
112 This option is currently not supported by any of the existing
113 authentication mechanisms, and is thus the same as specifying
114 .Cm valid .
115 .It none
116 This is the default state. Authentication information is not
117 required. If no or insufficient authentication information is
118 provided, then the
119 .Xr login 1
120 program will provide the necessary user verification.
121 .It off
122 This disables the authentication code. All user verification will
123 happen through the
124 .Xr login 1
125 program.
126 .El
127 .It Fl D Ar debugmode
128 This option may be used for debugging purposes. It allows
129 .Nm telnetd
130 to print out debugging information to the connection, allowing the
131 user to see what
132 .Nm telnetd
133 is doing. Repeated use of the option arranges composite debug reports.
134 There are several possible values for
135 .Ar debugmode:
136 .Bl -tag -width exercise
137 .It Cm options
138 Prints information about the negotiation of
139 .Tn telnet
140 options.
141 .It Cm report
142 Prints the
143 .Cm options
144 information, plus some additional information about what processing is
145 going on.
146 .It Cm netdata
147 Displays the data stream received by
148 .Nm telnetd.
149 .It Cm ptydata
150 Displays data written to the pty.
151 .It Cm exercise
152 Has not been implemented yet.
153 .El
154 .It Fl edebug
155 If
156 .Nm telnetd
157 has been compiled with support for encryption, then the
158 .Fl edebug
159 option may be used to enable encryption debugging code.
160 .It Fl h
161 Disables the printing of host-specific information before
162 login has been completed.
163 .It Fl L Ar loginprg
164 This option may be used to specify a different login program.
165 By default,
166 .Pa /usr/lib/telnetlogin
167 is used.
168 .It Fl n
169 Disable
170 .Dv TCP
171 keep-alives. Normally
172 .Nm telnetd
173 enables the
174 .Tn TCP
175 keep-alive mechanism to probe connections that
176 have been idle for some period of time to determine
177 if the client is still there, so that idle connections
178 from machines that have crashed or can no longer
179 be reached may be cleaned up.
180 .It Fl N
181 Disable reverse DNS lookups and use the numeric IP address in logs
182 and REMOTEHOST environment variable.
183 .It Fl s
184 This option is only enabled if
185 .Nm telnetd
186 is compiled with support for
187 .Tn SecurID
188 cards.
189 It causes the
190 .Fl s
191 option to be passed on to
192 .Xr login 1 ,
193 and thus is only useful if
194 .Xr login 1
195 supports the
196 .Fl s
197 flag to indicate that only
198 .Tn SecurID
199 validated logins are allowed. This is usually useful for controlling
200 remote logins from outside of a firewall.
201 .It Fl S Ar tos
202 Sets the IP type-of-service (TOS) option for the telnet
203 connection to the value
204 .Ar tos .
205 .It Fl X Ar authtype
206 This option is only valid if
207 .Nm telnetd
208 has been built with support for the authentication option.
209 It disables the use of
210 .Ar authtype
211 authentication, and
212 can be used to temporarily disable
213 a specific authentication type without having to recompile
214 .Nm telnetd .
215 .It Fl z Ar SSL-parameter
216 This option is only valid if
217 .Nm telnetd
218 has been built with SSL (Secure Socket Layer) support.
219 .Bl -tag -width Fl
220 .It Ic debug
221 Enable SSL related debugging.
222 .It Ic debug= Ns Ar log_file
223 Select in addition a specific location
224 .Ar log_file
225 for collecting debug output, thus overriding the default file
226 .Ar /var/tmp/telnetd.log .
227 .It Ic ssl
228 Negotiate SSL at first, then use telnet protocol. In this mode telnetd
229 only accepts connections from SSL enhanced telnet with option
230 .Ic -z ssl
231 .It Ic nossl, !ssl
232 switch off SSL negotiation
233 .It Ic certsok
234 Look username up in
235 .Pa /etc/ssl.users .
236 The format of this file is lines of the form:
237 .Ar user1,user2:/C=US/.....
238 where user1 and user2 are usernames and /C=US/... is the subject name of
239 the certificate. Use
240 .Ar openssl x509 -subject -noout
241 to extract the subject name.
242 If client certificate is valid,
243 authenticate without password.
244 .It Ic certrequired
245 client certificate is mandatory
246 .It Ic secure
247 Don't switch back to unencrypted mode (no SSL) if SSL is not available.
248 .It Ic verify=int
249 Set the SSL verify flags. (See SSL_VERIFY_* in
250 .Ar openssl/ssl.h
251 ).
252 .It Ic cacert= Ns Ar CA_file
253 A collection of trusted authority certificates for verification of
254 whatever the clients care to send as identifiers.
255 .It Ic cert= Ns Ar cert_file
256 Present the certificate(s) in
257 .Ar cert_file
258 to any client. They are in PEM-format, and the first certificate
259 identifies the server itself.
260 .It Ic key= Ns Ar key_file
261 Use the key(s) in
262 .Ar key_file
263 in case a key is not stored together with the certificate.
264 .It Ic cipher= Ns Ar ciph_list
265 Set the preferred ciphers to
266 .Ar ciph_list .
267 .\" TODO: possible values; comma-separated list?
268 The environment variable SSL_CIPHER serves the same purpose.
269 (See
270 .Ar openssl/ssl.h
271 ).
272 .El
273 .El
274 .Pp
275 If the file
276 .Pa /etc/issue.net
277 is present,
278 .Nm telnetd
279 will display its contents before the login prompt of a telnet session (see
280 .Xr issue.net 5 ) .
281 .Pp
282 .Nm Telnetd
283 operates by allocating a pseudo-terminal device (see
284 .Xr pty 4 )
285 for a client, then creating a login process which has
286 the slave side of the pseudo-terminal as
287 .Dv stdin ,
288 .Dv stdout ,
289 and
290 .Dv stderr .
291 .Nm Telnetd
292 manipulates the master side of the pseudo-terminal,
293 implementing the
294 .Tn telnet
295 protocol and passing characters
296 between the remote client and the login process.
297 .Pp
298 When a
299 .Tn telnet
300 session is started up,
301 .Nm telnetd
302 sends
303 .Tn telnet
304 options to the client side indicating
305 a willingness to do the
306 following
307 .Tn telnet
308 options, which are described in more detail below:
309 .Bd -literal -offset indent
310 DO AUTHENTICATION
311 WILL ENCRYPT
312 DO TERMINAL TYPE
313 DO TSPEED
314 DO XDISPLOC
315 DO NEW-ENVIRON
316 WILL SUPPRESS GO AHEAD
317 DO ECHO
318 DO LINEMODE
319 DO NAWS
320 WILL STATUS
321 DO LFLOW
322 DO TIMING-MARK
323 .Ed
324 .Pp
325 The pseudo-terminal allocated to the client is configured
326 to operate in \(Lqcooked\(Rq mode, and with
327 .Dv XTABS
328 .Dv CRMOD
329 enabled (see
330 .Xr tty 4 ) .
331 .Pp
332 .Nm Telnetd
333 has support for enabling locally the following
334 .Tn telnet
335 options:
336 .Bl -tag -width "DO AUTHENTICATION"
337 .It "WILL ECHO"
338 When the
339 .Dv LINEMODE
340 option is enabled, a
341 .Dv WILL ECHO
342 or
343 .Dv WONT ECHO
344 will be sent to the client to indicate the
345 current state of terminal echoing.
346 When terminal echo is not desired, a
347 .Dv WILL ECHO
348 is sent to indicate that
349 .Tn telnetd
350 will take care of echoing any data that needs to be
351 echoed to the terminal, and then nothing is echoed.
352 When terminal echo is desired, a
353 .Dv WONT ECHO
354 is sent to indicate that
355 .Tn telnetd
356 will not be doing any terminal echoing, so the
357 client should do any terminal echoing that is needed.
358 .It "WILL BINARY"
359 Indicates that the client is willing to send a
360 8 bits of data, rather than the normal 7 bits
361 of the Network Virtual Terminal.
362 .It "WILL SGA"
363 Indicates that it will not be sending
364 .Dv IAC GA,
365 go ahead, commands.
366 .It "WILL STATUS"
367 Indicates a willingness to send the client, upon
368 request, of the current status of all
369 .Tn TELNET
370 options.
371 .It "WILL TIMING-MARK"
372 Whenever a
373 .Dv DO TIMING-MARK
374 command is received, it is always responded
375 to with a
376 .Dv WILL TIMING-MARK
377 .It "WILL LOGOUT"
378 When a
379 .Dv DO LOGOUT
380 is received, a
381 .Dv WILL LOGOUT
382 is sent in response, and the
383 .Tn TELNET
384 session is shut down.
385 .It "WILL ENCRYPT"
386 Only sent if
387 .Nm telnetd
388 is compiled with support for data encryption, and
389 indicates a willingness to decrypt
390 the data stream.
391 .El
392 .Pp
393 .Nm Telnetd
394 has support for enabling remotely the following
395 .Tn TELNET
396 options:
397 .Bl -tag -width "DO AUTHENTICATION"
398 .It "DO BINARY"
399 Sent to indicate that
400 .Tn telnetd
401 is willing to receive an 8 bit data stream.
402 .It "DO LFLOW"
403 Requests that the client handle flow control
404 characters remotely.
405 .It "DO ECHO"
406 This is not really supported, but is sent to identify a 4.2BSD
407 .Xr telnet 1
408 client, which will improperly respond with
409 .Dv WILL ECHO.
410 If a
411 .Dv WILL ECHO
412 is received, a
413 .Dv DONT ECHO
414 will be sent in response.
415 .It "DO TERMINAL-TYPE"
416 Indicates a desire to be able to request the
417 name of the type of terminal that is attached
418 to the client side of the connection.
419 .It "DO SGA"
420 Indicates that it does not need to receive
421 .Dv IAC GA,
422 the go ahead command.
423 .It "DO NAWS"
424 Requests that the client inform the server when
425 the window (display) size changes.
426 .It "DO TERMINAL-SPEED"
427 Indicates a desire to be able to request information
428 about the speed of the serial line to which
429 the client is attached.
430 .It "DO XDISPLOC"
431 Indicates a desire to be able to request the name
432 of the X windows display that is associated with
433 the telnet client.
434 .It "DO NEW-ENVIRON"
435 Indicates a desire to be able to request environment
436 variable information, as described in RFC 1572.
437 .It "DO LINEMODE"
438 Only sent if
439 .Nm telnetd
440 is compiled with support for linemode, and
441 requests that the client do line by line processing.
442 .It "DO TIMING-MARK"
443 Only sent if
444 .Nm telnetd
445 is compiled with support for both linemode and
446 kludge linemode, and the client responded with
447 .Dv WONT LINEMODE.
448 If the client responds with
449 .Dv WILL TM,
450 the it is assumed that the client supports
451 kludge linemode.
452 Note that the
453 .Op Fl k
454 option can be used to disable this.
455 .It "DO AUTHENTICATION"
456 Only sent if
457 .Nm telnetd
458 is compiled with support for authentication, and
459 indicates a willingness to receive authentication
460 information for automatic login.
461 .It "DO ENCRYPT"
462 Only sent if
463 .Nm telnetd
464 is compiled with support for data encryption, and
465 indicates a willingness to decrypt
466 the data stream.
467 .El
468 .Sh FILES
469 .Pa /etc/services ,
470 .Pa /etc/issue.net ,
471 .Pa /etc/ssl.users
472 .Sh "SEE ALSO"
473 .Xr telnet 1 ,
474 .Xr login 1 ,
475 .Xr issue.net 5 ,
476 .Sh STANDARDS
477 .Bl -tag -compact -width RFC-1572
478 .It Cm RFC-854
479 .Tn TELNET
480 PROTOCOL SPECIFICATION
481 .It Cm RFC-855
482 TELNET OPTION SPECIFICATIONS
483 .It Cm RFC-856
484 TELNET BINARY TRANSMISSION
485 .It Cm RFC-857
486 TELNET ECHO OPTION
487 .It Cm RFC-858
488 TELNET SUPPRESS GO AHEAD OPTION
489 .It Cm RFC-859
490 TELNET STATUS OPTION
491 .It Cm RFC-860
492 TELNET TIMING MARK OPTION
493 .It Cm RFC-861
494 TELNET EXTENDED OPTIONS - LIST OPTION
495 .It Cm RFC-885
496 TELNET END OF RECORD OPTION
497 .It Cm RFC-1073
498 Telnet Window Size Option
499 .It Cm RFC-1079
500 Telnet Terminal Speed Option
501 .It Cm RFC-1091
502 Telnet Terminal-Type Option
503 .It Cm RFC-1096
504 Telnet X Display Location Option
505 .It Cm RFC-1123
506 Requirements for Internet Hosts -- Application and Support
507 .It Cm RFC-1184
508 Telnet Linemode Option
509 .It Cm RFC-1372
510 Telnet Remote Flow Control Option
511 .It Cm RFC-1416
512 Telnet Authentication Option
513 .It Cm RFC-1411
514 Telnet Authentication: Kerberos Version 4
515 .It Cm RFC-1412
516 Telnet Authentication: SPX
517 .It Cm RFC-1571
518 Telnet Environment Option Interoperability Issues
519 .It Cm RFC-1572
520 Telnet Environment Option
521 .El
522 .Sh BUGS
523 Some
524 .Tn TELNET
525 commands are only partially implemented.
526 .Pp
527 Because of bugs in the original 4.2 BSD
528 .Xr telnet 1 ,
529 .Nm telnetd
530 performs some dubious protocol exchanges to try to discover if the remote
531 client is, in fact, a 4.2 BSD
532 .Xr telnet 1 .
533 .Pp
534 Binary mode
535 has no common interpretation except between similar operating systems
536 (Unix in this case).
537 .Pp
538 The terminal type name received from the remote client is converted to
539 lower case.
540 .Pp
541 .Nm Telnetd
542 never sends
543 .Tn TELNET
544 .Dv IAC GA
545 (go ahead) commands.
546 .Pp
547 The source code is not comprehensible.