DENX . DULG . TelnetServerNotWorking

14.3.33. Telnet / SSH (dropbear) server not working

The telnet server is running on the target but when I try to login I get this error message:
$ telnet
Connected to
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@
root@'s password: 
PTY allocation request failed on channel 0
shell request failed on channel 0

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

----- Revision r1.1 - 19 Jan 2010 - 13:44 - DetlevZundel
Copyright © 2002-2019 by DENX Software Engineering