for connected embedded systems
![]() |
![]() |
![]() |
![]() |
telnetd
DARPA TELNET protocol daemon (UNIX)
![]() |
You must be root to start this daemon. |
Syntax:
telnetd [-46] [-debug [port]] [-D modifier] [-n]
Options:
- -4 or -6
- Specifies the address family to be used for -debug mode. During normal operation (called from inetd), telnetd will use the file descriptor passed from inetd.
- -D modifier
- Print debugging information. You can specify any of the
following:
- options
- Print information about the negotiation of TELNET options.
- report
- Print the options information, plus some additional information about what processing is going on.
- netdata
- Display the data stream received by telnetd.
- ptydata
- Display data written to the pty.
- -debug [port]
- Normally, telnetd is started automatically through inetd; this option lets you start telnetd manually.
- -n
- Disable the keepalive option.
Description:
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.
![]() |
If you get a message saying that all network ports are in use, you've either run out of pseudo devices or you haven't started devc-pty. The telnetd daemon looks only at the pseudo-terminal devices named /dev/pty[pqrs][0-f], no matter how many others are created. |
When a TELNET session is started up, telnetd sends TELNET options to the client side that indicate a willingness to do remote echo 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:
- echo
- binary
- suppress go ahead
- timing mark.
It's also willing to have the remote client do:
- linemode
- binary
- terminal type
- terminal speed
- window size
- toggle flow control
- environment
- X display location
- suppress go ahead.
Name resolving issues
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 is not, a delay of up to 1.5 minutes may be introduced at login time before a login prompt is returned to the client. The socket library name resolver is attempting 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. In the event you like to run telnetd on an embedded target -- you need to, first, move a number of files to your target, as follows:
- io-net
- Ethernet driver shared object (i.e. devn-ne2000.so)
- TCP/IP shared object (i.e. npm-tcpip.so)
- libsocket.so
- devc-pty for pseudo tty support. You should use -n option for this daemon to specify the number of sessions, e.g. each telnet session uses 1 (one) pseudo device.
- ifconfig and route -- both these utilities are used to configure your network interface. These utilities could be replaced by dhcp.client.
- inetd -- this daemon is the Internet super-server.
- inetd.conf --
TCP service daemons are listed in this file.
The location of inetd and inetd.conf are /usr/sbin, and /etc resectively. If you decide to move inetd.conf to another location, you need to tell inetd in the command line.

The minimal inetd.conf contents to make telnetd work:
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 }
- /usr/sbin/telnetd
The location for telnetd is /usr/sbin/telnetd. If you move telnetd to other location, modify the inetd.conf accordingly.
The following files are put on target in the locations listed:
- /etc/services -- maps service names such as telnet to a port # (23).
- /bin/login
login can be linked to sh or another binary if the user does not want to actually login, but /etc/passwd must be included if they are to login.
- /etc/termcap
- /usr/lib/terminfo
- /bin/sh
- /etc/hosts
or /etc/resolv.conf
or CS_RESOLVE
See "Name resolving issues" for more information.
Then you configure the interface in a shell prompt either by ifconfig and route or dhcp.client, and start inetd.
Files:
The telnetd daemon requires the libsocket.so shared library.
License:
This utility is based on copyright software of the WIDE project and of the Regents of the University of California; for the copyright notices, see telnetd in the appendix Third-Party Copyright Notices.
Caveats:
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.
See also:
/etc/hosts, ifconfig, inetd, inetd.conf, login, /etc/resolv.conf, rlogind, route, rshd, /etc/services, sh, telnet
TCP/IP Networking in the Neutrino User's Guide
RFC 854
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)