chroot系统中,启动sshd -d 后,不能正常登录报错Ssh, error: openpty: No such file or directory
if you get the error
PTY allocation request failed on channel 0 stdin: is not a tty
and in your auth.log is written:
error: openpty: No such file or directory error: session_pty_req: session 0 alloc failed
- try the following, but always first check, if the step is already done:
mknod /dev/ptmx c 5 2 chmod 666 /dev/ptmx mkdir /dev/pts
- Add to /etc/fstab:
none /dev/pts devpts gid=5,mode=620 0 0
- Mount /dev/pts
mount /dev/pts
ln -sf /dev/null /dev/tty2 ln -sf /dev/null /dev/tty3 ln -sf /dev/null /dev/tty4
ln -sf /dev/null /dev/tty