| 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 valid |
| 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 E , -exec-login Ar string |
| 124 |
Set the program to be executed instead of |
| 125 |
.Pa /bin/login . |
| 126 |
.It Fl h , -no-hostinfo |
| 127 |
Disables the printing of host-specific information before |
| 128 |
login has been completed. |
| 129 |
.It Fl l , -linemode Op Ar mode |
| 130 |
Specifies line mode. Tries to force clients to use line- |
| 131 |
at-a-time mode. |
| 132 |
If |
| 133 |
.Ar mode |
| 134 |
is |
| 135 |
.Cm nokludge , |
| 136 |
then automatic klugde linemode will be disabled. |
| 137 |
If the |
| 138 |
.Dv LINEMODE |
| 139 |
option is not supported, it will go |
| 140 |
into kludge linemode. |
| 141 |
.It Fl n , -no-keepalive |
| 142 |
Disable |
| 143 |
.Dv TCP |
| 144 |
keep-alives. Normally |
| 145 |
.Nm telnetd |
| 146 |
enables the |
| 147 |
.Tn TCP |
| 148 |
keep-alive mechanism to probe connections that |
| 149 |
have been idle for some period of time to determine |
| 150 |
if the client is still there, so that idle connections |
| 151 |
from machines that have crashed or can no longer |
| 152 |
be reached may be cleaned up. |
| 153 |
.It Fl U , -reverse-lookup |
| 154 |
This option causes |
| 155 |
.Nm telnetd |
| 156 |
to refuse connections from addresses that |
| 157 |
cannot be mapped back into a symbolic name |
| 158 |
via the |
| 159 |
.Xr gethostbyaddr 3 |
| 160 |
routine. |
| 161 |
.It Fl ? , -help |
| 162 |
Display a help list. |
| 163 |
.It Fl -usage |
| 164 |
Display a short usage message. |
| 165 |
.It Fl V , -version |
| 166 |
Display program version. |
| 167 |
.El |
| 168 |
.Sh OPERATION |
| 169 |
.Nm telnetd |
| 170 |
operates by allocating a pseudo-terminal device (see |
| 171 |
.Xr pty 4 ) |
| 172 |
for a client, then creating a login process which has |
| 173 |
the slave side of the pseudo-terminal as |
| 174 |
.Dv stdin , |
| 175 |
.Dv stdout |
| 176 |
and |
| 177 |
.Dv stderr . |
| 178 |
.Nm telnetd |
| 179 |
manipulates the master side of the pseudo-terminal, |
| 180 |
implementing the |
| 181 |
.Tn TELNET |
| 182 |
protocol and passing characters |
| 183 |
between the remote client and the login process. |
| 184 |
.Pp |
| 185 |
When a |
| 186 |
.Tn TELNET |
| 187 |
session is started up, |
| 188 |
.Nm telnetd |
| 189 |
sends |
| 190 |
.Tn TELNET |
| 191 |
options to the client side indicating |
| 192 |
a willingness to do the |
| 193 |
following |
| 194 |
.Tn TELNET |
| 195 |
options, which are described in more detail below: |
| 196 |
.Bd -literal -offset indent |
| 197 |
DO AUTHENTICATION |
| 198 |
WILL ENCRYPT |
| 199 |
DO TERMINAL TYPE |
| 200 |
DO TSPEED |
| 201 |
DO XDISPLOC |
| 202 |
DO NEW-ENVIRON |
| 203 |
DO ENVIRON |
| 204 |
WILL SUPPRESS GO AHEAD |
| 205 |
DO ECHO |
| 206 |
DO LINEMODE |
| 207 |
DO NAWS |
| 208 |
WILL STATUS |
| 209 |
DO LFLOW |
| 210 |
DO TIMING-MARK |
| 211 |
.Ed |
| 212 |
.Pp |
| 213 |
The pseudo-terminal allocated to the client is configured |
| 214 |
to operate in |
| 215 |
.Dq cooked |
| 216 |
mode, and with |
| 217 |
.Dv XTABS and |
| 218 |
.Dv CRMOD |
| 219 |
enabled (see |
| 220 |
.Xr tty 4 ) . |
| 221 |
.Pp |
| 222 |
.Nm telnetd |
| 223 |
has support for enabling locally the following |
| 224 |
.Tn TELNET |
| 225 |
options: |
| 226 |
.Bl -tag -width "DO AUTHENTICATION" |
| 227 |
.It "WILL ECHO" |
| 228 |
When the |
| 229 |
.Dv LINEMODE |
| 230 |
option is enabled, a |
| 231 |
.Dv WILL ECHO |
| 232 |
or |
| 233 |
.Dv WONT ECHO |
| 234 |
will be sent to the client to indicate the |
| 235 |
current state of terminal echoing. |
| 236 |
When terminal echo is not desired, a |
| 237 |
.Dv WILL ECHO |
| 238 |
is sent to indicate that |
| 239 |
.Tn telnetd |
| 240 |
will take care of echoing any data that needs to be |
| 241 |
echoed to the terminal, and then nothing is echoed. |
| 242 |
When terminal echo is desired, a |
| 243 |
.Dv WONT ECHO |
| 244 |
is sent to indicate that |
| 245 |
.Tn telnetd |
| 246 |
will not be doing any terminal echoing, so the |
| 247 |
client should do any terminal echoing that is needed. |
| 248 |
.It "WILL BINARY" |
| 249 |
Indicates that the client is willing to send a |
| 250 |
8 bits of data, rather than the normal 7 bits |
| 251 |
of the Network Virtual Terminal. |
| 252 |
.It "WILL SGA" |
| 253 |
Indicates that it will not be sending |
| 254 |
.Dv IAC GA, |
| 255 |
go ahead, commands. |
| 256 |
.It "WILL STATUS" |
| 257 |
Indicates a willingness to send the client, upon |
| 258 |
request, of the current status of all |
| 259 |
.Tn TELNET |
| 260 |
options. |
| 261 |
.It "WILL TIMING-MARK" |
| 262 |
Whenever a |
| 263 |
.Dv DO TIMING-MARK |
| 264 |
command is received, it is always responded |
| 265 |
to with a |
| 266 |
.Dv WILL TIMING-MARK |
| 267 |
.ne 1i |
| 268 |
.It "WILL LOGOUT" |
| 269 |
When a |
| 270 |
.Dv DO LOGOUT |
| 271 |
is received, a |
| 272 |
.Dv WILL LOGOUT |
| 273 |
is sent in response, and the |
| 274 |
.Tn TELNET |
| 275 |
session is shut down. |
| 276 |
.It "WILL ENCRYPT" |
| 277 |
Only sent if |
| 278 |
.Nm telnetd |
| 279 |
is compiled with support for data encryption, and |
| 280 |
indicates a willingness to decrypt |
| 281 |
the data stream. |
| 282 |
.El |
| 283 |
.Pp |
| 284 |
.Nm telnetd |
| 285 |
has support for enabling remotely the following |
| 286 |
.Tn TELNET |
| 287 |
options: |
| 288 |
.Bl -tag -width "DO AUTHENTICATION" |
| 289 |
.It "DO BINARY" |
| 290 |
Sent to indicate that |
| 291 |
.Tn telnetd |
| 292 |
is willing to receive an 8 bit data stream. |
| 293 |
.It "DO LFLOW" |
| 294 |
Requests that the client handle flow control |
| 295 |
characters remotely. |
| 296 |
.It "DO ECHO" |
| 297 |
This is not really supported, but is sent to identify a 4.2BSD |
| 298 |
.Xr telnet 1 |
| 299 |
client, which will improperly respond with |
| 300 |
.Dv WILL ECHO. |
| 301 |
If a |
| 302 |
.Dv WILL ECHO |
| 303 |
is received, a |
| 304 |
.Dv DONT ECHO |
| 305 |
will be sent in response. |
| 306 |
.It "DO TERMINAL-TYPE" |
| 307 |
Indicates a desire to be able to request the |
| 308 |
name of the type of terminal that is attached |
| 309 |
to the client side of the connection. |
| 310 |
.It "DO SGA" |
| 311 |
Indicates that it does not need to receive |
| 312 |
.Dv IAC GA, |
| 313 |
the go ahead command. |
| 314 |
.It "DO NAWS" |
| 315 |
Requests that the client inform the server when |
| 316 |
the window (display) size changes. |
| 317 |
.It "DO TERMINAL-SPEED" |
| 318 |
Indicates a desire to be able to request information |
| 319 |
about the speed of the serial line to which |
| 320 |
the client is attached. |
| 321 |
.It "DO XDISPLOC" |
| 322 |
Indicates a desire to be able to request the name |
| 323 |
of the X windows display that is associated with |
| 324 |
the telnet client. |
| 325 |
.It "DO NEW-ENVIRON" |
| 326 |
Indicates a desire to be able to request environment |
| 327 |
variable information, as described in RFC 1572. |
| 328 |
.It "DO ENVIRON" |
| 329 |
Indicates a desire to be able to request environment |
| 330 |
variable information, as described in RFC 1408. |
| 331 |
.It "DO LINEMODE" |
| 332 |
Only sent if |
| 333 |
.Nm telnetd |
| 334 |
is compiled with support for linemode, and |
| 335 |
requests that the client do line by line processing. |
| 336 |
.It "DO TIMING-MARK" |
| 337 |
Only sent if |
| 338 |
.Nm telnetd |
| 339 |
is compiled with support for both linemode and |
| 340 |
kludge linemode, and the client responded with |
| 341 |
.Dv WONT LINEMODE. |
| 342 |
If the client responds with |
| 343 |
.Dv WILL TM, |
| 344 |
the it is assumed that the client supports |
| 345 |
kludge linemode. |
| 346 |
Note that the |
| 347 |
.Op Fl k |
| 348 |
option can be used to disable this. |
| 349 |
.It "DO AUTHENTICATION" |
| 350 |
Only sent if |
| 351 |
.Nm telnetd |
| 352 |
is compiled with support for authentication, and |
| 353 |
indicates a willingness to receive authentication |
| 354 |
information for automatic login. |
| 355 |
.It "DO ENCRYPT" |
| 356 |
Only sent if |
| 357 |
.Nm telnetd |
| 358 |
is compiled with support for data encryption, and |
| 359 |
indicates a willingness to decrypt |
| 360 |
the data stream. |
| 361 |
.El |
| 362 |
.Sh FILES |
| 363 |
.Pa /etc/services |
| 364 |
.Sh "SEE ALSO" |
| 365 |
.Xr telnet 1 , |
| 366 |
.Xr login 1 , |
| 367 |
.Xr bftp 1 |
| 368 |
(if supported) |
| 369 |
.Sh STANDARDS |
| 370 |
.Bl -tag -compact -width RFC-1572 |
| 371 |
.It Cm RFC-854 |
| 372 |
.Tn TELNET |
| 373 |
PROTOCOL SPECIFICATION |
| 374 |
.It Cm RFC-855 |
| 375 |
TELNET OPTION SPECIFICATIONS |
| 376 |
.It Cm RFC-856 |
| 377 |
TELNET BINARY TRANSMISSION |
| 378 |
.It Cm RFC-857 |
| 379 |
TELNET ECHO OPTION |
| 380 |
.It Cm RFC-858 |
| 381 |
TELNET SUPPRESS GO AHEAD OPTION |
| 382 |
.It Cm RFC-859 |
| 383 |
TELNET STATUS OPTION |
| 384 |
.It Cm RFC-860 |
| 385 |
TELNET TIMING MARK OPTION |
| 386 |
.It Cm RFC-861 |
| 387 |
TELNET EXTENDED OPTIONS - LIST OPTION |
| 388 |
.It Cm RFC-885 |
| 389 |
TELNET END OF RECORD OPTION |
| 390 |
.It Cm RFC-1073 |
| 391 |
Telnet Window Size Option |
| 392 |
.It Cm RFC-1079 |
| 393 |
Telnet Terminal Speed Option |
| 394 |
.It Cm RFC-1091 |
| 395 |
Telnet Terminal-Type Option |
| 396 |
.It Cm RFC-1096 |
| 397 |
Telnet X Display Location Option |
| 398 |
.It Cm RFC-1123 |
| 399 |
Requirements for Internet Hosts -- Application and Support |
| 400 |
.It Cm RFC-1184 |
| 401 |
Telnet Linemode Option |
| 402 |
.It Cm RFC-1372 |
| 403 |
Telnet Remote Flow Control Option |
| 404 |
.It Cm RFC-1416 |
| 405 |
Telnet Authentication Option |
| 406 |
.It Cm RFC-1411 |
| 407 |
Telnet Authentication: Kerberos Version 4 |
| 408 |
.It Cm RFC-1412 |
| 409 |
Telnet Authentication: SPX |
| 410 |
.It Cm RFC-1571 |
| 411 |
Telnet Environment Option Interoperability Issues |
| 412 |
.It Cm RFC-1572 |
| 413 |
Telnet Environment Option |
| 414 |
.El |
| 415 |
.Sh BUGS |
| 416 |
Some |
| 417 |
.Tn TELNET |
| 418 |
commands are only partially implemented. |
| 419 |
.Pp |
| 420 |
Because of bugs in the original 4.2 BSD |
| 421 |
.Xr telnet 1 , |
| 422 |
.Nm telnetd |
| 423 |
performs some dubious protocol exchanges to try to discover if the remote |
| 424 |
client is, in fact, a 4.2 BSD |
| 425 |
.Xr telnet 1 . |
| 426 |
.Pp |
| 427 |
Binary mode |
| 428 |
has no common interpretation except between similar operating systems |
| 429 |
(Unix in this case). |
| 430 |
.Pp |
| 431 |
The terminal type name received from the remote client is converted to |
| 432 |
lower case. |
| 433 |
.Pp |
| 434 |
.Nm telnetd |
| 435 |
never sends |
| 436 |
.Tn TELNET |
| 437 |
.Dv IAC GA |
| 438 |
(go ahead) commands. |