DARPA TELNET protocol daemon (UNIX)
telnetd [-debug] [-D (options|report|netstat|ptydata)] [-h] [-n] [-U] [-46] [port]
Neutrino
The telnetd daemon is a server that supports the DARPA-standard TELNET virtual-terminal protocol.
The telnetd daemon is started when inetd receives a service request to connect to the TELNET port (inetd listens for service requests specified in the inetd.conf file at a port defined in the services file).
By specifying the -debug option, you can start up telnetd manually instead of through inetd. If you start telnetd this way, you can use the port argument to run telnetd on an alternate TCP port number.
You can use the -D option for debugging. This option lets telnet print debugging information to the connection, letting you see what telnetd is doing.
The telnetd daemon operates by allocating a pseudo-terminal device for a client, then creating a login process that has the slave side of the pseudo-terminal as standard input, standard output, and standard error. The telnetd daemon 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 up, telnetd sends TELNET options to the client side that indicate a willingness to do remote echoing of characters, to suppress go-ahead, and to do remote flow control, as well as to receive terminal-type information, terminal-speed information, and window-size information from the remote client. If the remote client is willing, the remote terminal type is propagated in the environment of the created login process. The pseudo-terminal allocated to the client is configured to operate in cooked mode, and with XTABS and CRMOD enabled.
The telnetd daemon is willing to do:
It's also willing to have the remote client do:
It is not mandatory for telnetd to have access to name-resolving capabilities. If it does have access to these capabilities, telnetd does a reverse name lookup (IP to hostname) of the telnet client.
If you decide to use a nameserver, make sure that the nameserver configuration is correct. If it isn't, there could be a delay of up to 1.5 minutes a login prompt is returned to the client, while the socket library's name resolver attempts to resolve the IP to a hostname.
Typical configuration for running telnetd on an embedded target
As mentioned before, in a host system environment, you run telnetd by just typing inetd in the command line. If you want to run telnetd on an embedded target, you need to copy the following files to your target:
The location of inetd and inetd.conf are /usr/sbin, and /etc respectively. If you decide to move inetd.conf to another location, you need to tell inetd in the command line.
inetd.conf = { # Internet services syntax: # <service_name> <socket_type> <proto> <flags> <user> <server_pathname><args> telnet stream tcp nowait root /usr/sbin/telnetd in.telnetd telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd }
You can link login to sh or another binary if you don't want to actually log in, but you must include /etc/passwd if you do want to log in.
For more information, see "Name resolving issues," above.
To configure the interface from a shell prompt, either use ifconfig and route or dhcp.client. You can then start inetd.
Based on:
RFC 854
The telnetd daemon requires the libsocket.so shared library.
This utility is based on copyright software of the WIDE project and of the Regents of the University of California; for licensing information, see the Third Party License Terms List at http://licensing.qnx.com/third-party-terms/.
Because of bugs in the original 4.2 BSD telnet, telnetd performs some protocol exchanges to try to discover if the remote client is, in fact, a 4.2 BSD telnet.
Binary mode has no common interpretation except between similar operating systems (UNIX in this case).
The terminal-type name received from the remote client is converted to lowercase.
The telnetd daemon never sends TELNET go-ahead commands.