Debian Codegraph @

upstream/debian-trixie/man8/telnetd.8

raw
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 .\" 4. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" @(#)telnetd.8 8.4 (Berkeley) 6/1/94
29 .\"
30 .Dd February 9, 2019
31 .Dt telnetd 8 SMM
32 .Os "GNU Network Utilities"
33 .Sh NAME
34 .Nm telnetd
35 .Nd DARPA
36 .Tn TELNET
37 protocol server
38 .Sh SYNOPSIS
39 .Nm telnetd
40 .Op Ar options ...
41 .Sh DESCRIPTION
42 The
43 .Nm telnetd
44 command is a server which supports the
45 .Tn DARPA
46 standard
47 .Tn TELNET
48 virtual terminal protocol.
49 .Nm telnetd
50 is normally invoked by the internet server (see
51 .Xr inetd 8 )
52 for requests to connect to the
53 .Tn TELNET
54 port as indicated by the
55 .Pa /etc/services
56 file (see
57 .Xr services 5 ) .
58 .Sh OPTIONS
59 The
60 .Nm telnetd
61 command accepts the following options:
62 .Bl -tag -width "-a authmode"
63 .It Fl a , -authmode Ar authmode
64 This option may be used for specifying what mode should
65 be used for authentication.
66 Note that this option is only useful if
67 .Nm telnetd
68 has been compiled with support for the
69 .Dv AUTHENTICATION
70 option.
71 There are several valid values for
72 .Ar authmode :
73 .Bl -tag -width debug
74 .It Cm user
75 Only allow connections when the remote user
76 can provide valid authentication information
77 to identify the remote user,
78 and is allowed access to the specified account
79 without providing a password.
80 .It Cm valid
81 Only allow connections when the remote user
82 can provide valid authentication information
83 to identify the remote user.
84 The
85 .Xr login 1
86 command will provide any additional user verification
87 needed if the remote user is not allowed automatic
88 access to the specified account.
89 .It Cm other
90 Only allow connections that supply some authentication information.
91 This option is currently not supported
92 by any of the existing authentication mechanisms,
93 and is thus the same as specifying
94 .Fl a
95 .Cm valid .
96 .It Cm none
97 This is the default state.
98 Authentication information is not required.
99 If no or insufficient authentication information
100 is provided, then the
101 .Xr login 1
102 program will provide the necessary user
103 verification.
104 .It Cm off
105 This disables the authentication code.
106 All user verification will happen through the
107 .Xr login 1
108 program.
109 .El
110 .It Fl S , -server-principal Ar name
111 Set the Kerberos principal name for this server instance, with or without
112 an explicit realm.
113 .It Fl X , -disable-auth-type Ar authtype
114 This option is only valid if
115 .Nm telnetd
116 has been built with support for the authentication option.
117 It disables the use of
118 .Ar authtype
119 authentication, and
120 can be used to temporarily disable
121 a specific authentication type without having to recompile
122 .Nm telnetd .
123 .It Fl D , -debug Op Ar debugmode
124 This option may be used for debugging purposes.
125 This allows
126 .Nm telnetd
127 to write out debugging information to a
128 .Pa /run/telnet/debug.PID
129 file, allowing the user to see what
130 .Nm telnetd
131 is doing.
132 The exact file will be printed by
133 .Nm telnetd
134 on the
135 .Nm telnet
136 session.
137 There are several possible values for
138 .Ar debugmode :
139 .Bl -tag -width exercise
140 .It Cm options
141 Prints information about the negotiation of
142 .Tn TELNET
143 options.
144 .It Cm report
145 Prints the
146 .Cm options
147 information, plus some additional information
148 about what processing is going on.
149 .It Cm netdata
150 Displays the data stream received by
151 .Nm telnetd.
152 .It Cm ptydata
153 Displays data written to the pty.
154 .It Cm auth
155 Displays authentication information.
156 .It Cm encr
157 Displays encryption information.
158 .El
159 .It Fl E , -exec-login Ar string
160 Set the program to be executed instead of
161 .Pa /bin/login .
162 .It Fl h , -no-hostinfo
163 Disables the printing of host-specific information before
164 login has been completed.
165 .It Fl l , -linemode Op Ar mode
166 Specifies line mode. Tries to force clients to use line-
167 at-a-time mode.
168 If
169 .Ar mode
170 is
171 .Cm nokludge ,
172 then automatic klugde linemode will be disabled.
173 If the
174 .Dv LINEMODE
175 option is not supported, it will go
176 into kludge linemode.
177 .It Fl n , -no-keepalive
178 Disable
179 .Dv TCP
180 keep-alives. Normally
181 .Nm telnetd
182 enables the
183 .Tn TCP
184 keep-alive mechanism to probe connections that
185 have been idle for some period of time to determine
186 if the client is still there, so that idle connections
187 from machines that have crashed or can no longer
188 be reached may be cleaned up.
189 .It Fl U , -reverse-lookup
190 This option causes
191 .Nm telnetd
192 to refuse connections from addresses that
193 cannot be mapped back into a symbolic name
194 via the
195 .Xr gethostbyaddr 3
196 routine.
197 .It Fl ? , -help
198 Display a help list.
199 .It Fl -usage
200 Display a short usage message.
201 .It Fl V , -version
202 Display program version.
203 .El
204 .Sh OPERATION
205 .Nm telnetd
206 operates by allocating a pseudo-terminal device (see
207 .Xr pty 4 )
208 for a client, then creating a login process which has
209 the slave side of the pseudo-terminal as
210 .Dv stdin ,
211 .Dv stdout
212 and
213 .Dv stderr .
214 .Nm telnetd
215 manipulates the master side of the pseudo-terminal,
216 implementing the
217 .Tn TELNET
218 protocol and passing characters
219 between the remote client and the login process.
220 .Pp
221 When a
222 .Tn TELNET
223 session is started up,
224 .Nm telnetd
225 sends
226 .Tn TELNET
227 options to the client side indicating
228 a willingness to do the
229 following
230 .Tn TELNET
231 options, which are described in more detail below:
232 .Bd -literal -offset indent
233 DO AUTHENTICATION
234 WILL ENCRYPT
235 DO TERMINAL TYPE
236 DO TSPEED
237 DO XDISPLOC
238 DO NEW-ENVIRON
239 DO ENVIRON
240 WILL SUPPRESS GO AHEAD
241 DO ECHO
242 DO LINEMODE
243 DO NAWS
244 WILL STATUS
245 DO LFLOW
246 DO TIMING-MARK
247 .Ed
248 .Pp
249 The pseudo-terminal allocated to the client is configured
250 to operate in
251 .Dq cooked
252 mode, and with
253 .Dv XTABS and
254 .Dv CRMOD
255 enabled (see
256 .Xr tty 4 ) .
257 .Pp
258 .Nm telnetd
259 has support for enabling locally the following
260 .Tn TELNET
261 options:
262 .Bl -tag -width "DO AUTHENTICATION"
263 .It "WILL ECHO"
264 When the
265 .Dv LINEMODE
266 option is enabled, a
267 .Dv WILL ECHO
268 or
269 .Dv WONT ECHO
270 will be sent to the client to indicate the
271 current state of terminal echoing.
272 When terminal echo is not desired, a
273 .Dv WILL ECHO
274 is sent to indicate that
275 .Tn telnetd
276 will take care of echoing any data that needs to be
277 echoed to the terminal, and then nothing is echoed.
278 When terminal echo is desired, a
279 .Dv WONT ECHO
280 is sent to indicate that
281 .Tn telnetd
282 will not be doing any terminal echoing, so the
283 client should do any terminal echoing that is needed.
284 .It "WILL BINARY"
285 Indicates that the client is willing to send a
286 8 bits of data, rather than the normal 7 bits
287 of the Network Virtual Terminal.
288 .It "WILL SGA"
289 Indicates that it will not be sending
290 .Dv IAC GA,
291 go ahead, commands.
292 .It "WILL STATUS"
293 Indicates a willingness to send the client, upon
294 request, of the current status of all
295 .Tn TELNET
296 options.
297 .It "WILL TIMING-MARK"
298 Whenever a
299 .Dv DO TIMING-MARK
300 command is received, it is always responded
301 to with a
302 .Dv WILL TIMING-MARK
303 .ne 1i
304 .It "WILL LOGOUT"
305 When a
306 .Dv DO LOGOUT
307 is received, a
308 .Dv WILL LOGOUT
309 is sent in response, and the
310 .Tn TELNET
311 session is shut down.
312 .It "WILL ENCRYPT"
313 Only sent if
314 .Nm telnetd
315 is compiled with support for data encryption, and
316 indicates a willingness to decrypt
317 the data stream.
318 .El
319 .Pp
320 .Nm telnetd
321 has support for enabling remotely the following
322 .Tn TELNET
323 options:
324 .Bl -tag -width "DO AUTHENTICATION"
325 .It "DO BINARY"
326 Sent to indicate that
327 .Tn telnetd
328 is willing to receive an 8 bit data stream.
329 .It "DO LFLOW"
330 Requests that the client handle flow control
331 characters remotely.
332 .It "DO ECHO"
333 This is not really supported, but is sent to identify a 4.2BSD
334 .Xr telnet 1
335 client, which will improperly respond with
336 .Dv WILL ECHO.
337 If a
338 .Dv WILL ECHO
339 is received, a
340 .Dv DONT ECHO
341 will be sent in response.
342 .It "DO TERMINAL-TYPE"
343 Indicates a desire to be able to request the
344 name of the type of terminal that is attached
345 to the client side of the connection.
346 .It "DO SGA"
347 Indicates that it does not need to receive
348 .Dv IAC GA,
349 the go ahead command.
350 .It "DO NAWS"
351 Requests that the client inform the server when
352 the window (display) size changes.
353 .It "DO TERMINAL-SPEED"
354 Indicates a desire to be able to request information
355 about the speed of the serial line to which
356 the client is attached.
357 .It "DO XDISPLOC"
358 Indicates a desire to be able to request the name
359 of the X windows display that is associated with
360 the telnet client.
361 .It "DO NEW-ENVIRON"
362 Indicates a desire to be able to request environment
363 variable information, as described in RFC 1572.
364 .It "DO ENVIRON"
365 Indicates a desire to be able to request environment
366 variable information, as described in RFC 1408.
367 .It "DO LINEMODE"
368 Only sent if
369 .Nm telnetd
370 is compiled with support for linemode, and
371 requests that the client do line by line processing.
372 .It "DO TIMING-MARK"
373 Only sent if
374 .Nm telnetd
375 is compiled with support for both linemode and
376 kludge linemode, and the client responded with
377 .Dv WONT LINEMODE.
378 If the client responds with
379 .Dv WILL TM,
380 the it is assumed that the client supports
381 kludge linemode.
382 Note that the
383 .Op Fl k
384 option can be used to disable this.
385 .It "DO AUTHENTICATION"
386 Only sent if
387 .Nm telnetd
388 is compiled with support for authentication, and
389 indicates a willingness to receive authentication
390 information for automatic login.
391 .It "DO ENCRYPT"
392 Only sent if
393 .Nm telnetd
394 is compiled with support for data encryption, and
395 indicates a willingness to decrypt
396 the data stream.
397 .El
398 .Sh FILES
399 .Pa /etc/services
400 .Sh "SEE ALSO"
401 .Xr telnet 1 ,
402 .Xr login 1 ,
403 .Xr bftp 1
404 (if supported)
405 .Sh STANDARDS
406 .Bl -tag -compact -width RFC-1572
407 .It Cm RFC-854
408 .Tn TELNET
409 PROTOCOL SPECIFICATION
410 .It Cm RFC-855
411 TELNET OPTION SPECIFICATIONS
412 .It Cm RFC-856
413 TELNET BINARY TRANSMISSION
414 .It Cm RFC-857
415 TELNET ECHO OPTION
416 .It Cm RFC-858
417 TELNET SUPPRESS GO AHEAD OPTION
418 .It Cm RFC-859
419 TELNET STATUS OPTION
420 .It Cm RFC-860
421 TELNET TIMING MARK OPTION
422 .It Cm RFC-861
423 TELNET EXTENDED OPTIONS - LIST OPTION
424 .It Cm RFC-885
425 TELNET END OF RECORD OPTION
426 .It Cm RFC-1073
427 Telnet Window Size Option
428 .It Cm RFC-1079
429 Telnet Terminal Speed Option
430 .It Cm RFC-1091
431 Telnet Terminal-Type Option
432 .It Cm RFC-1096
433 Telnet X Display Location Option
434 .It Cm RFC-1123
435 Requirements for Internet Hosts -- Application and Support
436 .It Cm RFC-1184
437 Telnet Linemode Option
438 .It Cm RFC-1372
439 Telnet Remote Flow Control Option
440 .It Cm RFC-1416
441 Telnet Authentication Option
442 .It Cm RFC-1411
443 Telnet Authentication: Kerberos Version 4
444 .It Cm RFC-1412
445 Telnet Authentication: SPX
446 .It Cm RFC-1571
447 Telnet Environment Option Interoperability Issues
448 .It Cm RFC-1572
449 Telnet Environment Option
450 .El
451 .Sh BUGS
452 Some
453 .Tn TELNET
454 commands are only partially implemented.
455 .Pp
456 Because of bugs in the original 4.2 BSD
457 .Xr telnet 1 ,
458 .Nm telnetd
459 performs some dubious protocol exchanges to try to discover if the remote
460 client is, in fact, a 4.2 BSD
461 .Xr telnet 1 .
462 .Pp
463 Binary mode
464 has no common interpretation except between similar operating systems
465 (Unix in this case).
466 .Pp
467 The terminal type name received from the remote client is converted to
468 lower case.
469 .Pp
470 .Nm telnetd
471 never sends
472 .Tn TELNET
473 .Dv IAC GA
474 (go ahead) commands.