Skip to main content.

14.3.33. Telnet / SSH (dropbear) server not working

Question:
The telnet server is running on the target but when I try to login I get this error message:
$ telnet 192.168.20.12
telnet 192.168.20.12
Trying 192.168.20.12...
Connected to 192.168.20.12.
Escape character is '^]'.
telnetd: All network ports in use.
Connection closed by foreign host.
The dropbear ssh server fails in a similar fashion:
$ ssh root@192.168.20.12
root@192.168.20.12's password: 
PTY allocation request failed on channel 0
shell request failed on channel 0

Answer:
Application software on the target cannot open a PTY (pseudo terminal) to handle the incoming request. To understand the problem, we have to be aware that the linux kernel and glibc support two schemes to handle PTYs. The deprecated scheme is hooked to the kernel option CONFIG_LEGACY_PTYS and at runtime uses (static) device files /dev/ptyxx and /dev/ttyxx for the master- and the slave ends of the PTYs. For this to work, you need the kernel support and /dev/[pt]tyxx pairs (where xx usually is a letter in the range p-z followed by a hexadecimal digit) in the target file system.
The regular support is coupled to the linux kernel option CONFIG_UNIX98_PTYS and the devpts virtual filesystem which has to be mounted on the target. Together with the device special file /dev/ptmx this will dynamically create device files for the allocated PTYs below the mount point. To use it, the device file has to exist and the filesystem needs to be mounted, e.g. like this:
# mkdir /dev/pts
# mknod c 5 2 /dev/ptmx
# mount -t devpts devpts /dev/pts
14.3.32. Using and Configuring the SocketCAN Driver 1. Abstract 14.4. Self
Prev Home Next