The telnetd(1) command is a server that supports the
Defense Advanced Research Projects (DARPA) standard Telnet virtual
terminal protocol. The telnetd(1) command is normally
invoked by the Internet server inetd(1) for requests to
connect to the Telnet port (see the -i option). On an
Interix system, it can also be run as a service (see the
service(1) utility). The -debug option can be used to
start up telnetd(1) manually. If started up this way,
port can be specified to run telnetd(1) on an
alternate Transmission Control Protocol (TCP) port number.
The telnetd(1) command accepts the following options:
-Ddebugmode
This option can be used for debugging purposes. This allows
telnetd(1) to print out debugging information to the
connection, which enables the user to see what telnetd(1) is
doing. There are several possible values for debugmode:
options
Prints information about the negotiation of TELNET
options.
report
Prints the options(1) information, plus additional
information about processing that is taking place.
netdata
Displays the data stream received by telnetd(1).
ptydata
Displays data written to the pty.
exercise
Has not yet been implemented.
-debug
Enables debugging on each socket created by telnetd(1)
(see SO_DEBUG in socket(3)).
-h
Disables the printing of host-specific information before login
has been completed.
-i
Causes telnetd(1) to assume that stdin, stdout, and
stderr have been inherited from the parent. This allows
telnetd(1) to be started from inetd(1).
-K
Turns on kludge linemode (see also -k). If the client
responds with WILL TIMING-MARK in response to a DO TIMING-MARK),
telnetd(1) assumes that the client supports kludge linemode.
Unfortunately, many clients that do not support kludge linemode
pass the heuristic. The -K option is most useful if you are
certain that all clients will support kludge linemode.
-k
If the -k option is specified, and the remote client
does not support the LINEMODE option, telnetd(1) will
operate in character-at-a-time mode. (The server will only go into
kludge linemode if the the remote client requests it, by sending
DONT SUPPRESS-GO-AHEAD and DONT ECHO.) The -k option is most
useful when there are remote clients that do not support kludge
linemode, but pass the heuristic (if they respond with WILL
TIMING-MARK in response to a DO TIMING-MARK) for kludge linemode
support.
Most clients pass the heuristic even if they do not support
kludge linemode, so the -k behavior is the default behavior
for telnetd(1). Without this option, certain telnet clients
(such as those on Solaris systems before 2.4) behave
poorly.
-l
Specifies line mode. Tries to force clients to use
line-at-a-time mode. If the LINEMODE option is not supported, it
will go into kludge linemode.
-n
Disable TCP keep-alives. Normally telnetd(1) enables the
TCP keep-alive mechanism to probe connections that have been idle
for some period of time to determine whether the client is still
there so that idle connections from computers that have crashed or
can no longer be reached can be cleaned up.
-Q
Sets really quiet mode. Really quiet mode suppresses the entire
login banner, unlike -q, which only suppresses part of the
banner.
-q
Sets quiet mode. Quiet mode suppresses the banner describing
default login domains; telnetd(1) still prints the portion
of the banner with the operating system, version, computer name and
terminal.
-U
This option causes telnetd(1) to refuse connections from
addresses that cannot be mapped back into a symbolic name through
the gethostbyaddr(3) routine.
The telnetd(1) command operates by allocating a pseudo
terminal device (see pty(4)) for a client, then creating a login
process that has the subordinate (slave) side of the pseudo
terminal as stdin, stdout and stderr. The telnetd(1) command
manipulates the master side of the pseudo terminal, implementing
the Telnet protocol and passing characters between the remote
client and the login process.
When a Telnet session is started, telnetd(1) sends Telnet
options to the client side, indicating a willingness to do the
following Telnet options:
DO TERMINAL TYPE
DO TSPEED
DO XDISPLOC
DO NEW-ENVIRON
DO ENVIRON
WILL SUPPRESS GO AHEAD
DO NAWS
DO LFLOW
DO LINEMODE
WILL STATUS
The pseudo terminal allocated to the client is configured to
operate in cooked mode with XTABS and CRMOD enabled (see
tty(1)).
The telnetd(1) command has support for enabling the
following Telnet options locally:
WILL ECHO
When the LINEMODE option is enabled, a WILL ECHO or WONT ECHO
is sent to the client to indicate the current state of terminal
echoing. When terminal echo is not wanted, a WILL ECHO is sent to
indicate that telnetd(1) will take care of echoing any data
that must be echoed to the terminal, and then nothing is echoed.
When terminal echo is wanted, a WONT ECHO is sent to indicate that
telnetd(1) will not be doing any terminal echoing, so the
client should do any terminal echoing that is needed.
WILL BINARY
Indicates that the client is willing to send a eight bits of
data, rather than the normal seven bits of the Network Virtual
Terminal.
WILL SGA
Indicates that it will not be sending IAC GA, go ahead,
commands.
WILL STATUS
Indicates a willingness to send the client, upon request, the
current status of all Telnet options.
WILL TIMING-MARK
When a DO TIMING-MARK command is received, it is always
responded to with a WILL TIMING-MARK
WILL LOGOUT
When a DO LOGOUT is received, a WILL LOGOUT is sent in
response, and the Telnet session is shut down.
The telnetd(1) command has support for enabling the
following Telnet options remotely:
DO BINARY
Sent to indicate that telnetd(1) is willing to receive
an eight-bit data stream.
DO LFLOW
Requests that the client handle flow control characters
remotely.
DO ECHO
This is not really supported, but is sent to identify a 4.2
Berkeley Software Distribution (BSD) telnet(1) client, which
will improperly respond with WILL ECHO. If a WILL ECHO is received,
a DONT ECHO will be sent in response.
DO TERMINAL-TYPE
Indicates a desire to be able to request the name of the type
of terminal that is attached to the client side of the
connection.
DO SGA
Indicates that it does not need to receive IAC GA, the go ahead
command.
DO NAWS
Requests that the client inform the server when the window
(display) size changes.
DO TERMINAL-SPEED
Indicates a desire to be able to request information about the
speed of the serial line to which the client is attached.
DO XDISPLOC
Indicates a desire to be able to request the name of the X
windows display that is associated with the Telnet client.
DO NEW-ENVIRON
Indicates a desire to be able to request environment variable
information, as described in RFC 1572.
DO ENVIRON
Indicates a desire to be able to request environment variable
information, as described in RFC 1408.
DO LINEMODE
Only sent if telnetd(1) is compiled with support for
linemode, and requests that the client do line-by-line processing.
This is enabled in Interix.
DO TIMING-MARK
Only sent if telnetd(1) is compiled with support for
both linemode and kludge linemode, and the client responded with
WONT LINEMODE. If the client responds with WILL TM, it is assumed
that the client supports kludge linemode. Note that the -k
option can be used to disable this.
Do not mount drives using NET.EXE(1) from a session
controlled by this daemon. See the service(1) reference page
for more discussion.
The default domain presented in the login banner can be changed
by setting the Windows registry variable
HKEY_LOCAL_MACHINE\Software\Microsoft\Services For
Unix\LoginDefaultDomain to the name of the domain.
If the telnetd(1) is running on a Windows workgroup
server without a domain, set the value of LoginDefaultDomain
to an empty string. If you do not do this, users will have to type
+loginname to login to the server.
Some Telnet commands are only partially implemented.
Because of bugs in the original Berkeley Software Distribution
(BSD) 4.2 telnet(1), telnetd(1) performs some dubious
protocol exchanges to try to discover whether the remote client is
actually a 4.2 BSD telnet(1).
Binary mode has no common interpretation except between similar
operating systems.
The terminal type name received from the remote client is
converted to lowercase.
The telnetd(1) command never sends TELNET IAC GA (go
ahead) commands.