PTY allocation request failed on channel 0
PTY allocation request failed on channel 0
20/02/2009
Yesterday, I was trying to login to my machine and I got the following message:
PTY allocation request failed on channel 0
My prompt was stuck and I could not enter commands. This happened because -for some reason- the tty related devices(/dev/ptmx, /dev/pts) were not created or mounted on my machine. In order to get this problem resolved, I created and mounted the missing devices using the following commands:
写进rc.local
1.rm -rf /dev/ptmx
2.mknod /dev/ptmx c 5 2
3.chmod 666 /dev/ptmx
4.umount /dev/pts
5.rm -rf /dev/pts
6.mkdir /dev/pts
7.mount /dev/pts
In order to be able to execute commands you will have to login to your machine(isn’t this supposed to be the original problem :) ).
This will do the trick:
1.ssh user@host "/bin/bash -i"
My VPS is built on openVZ but I have seen this problem occur also in XEN machines.
Leave me a comment if this works for you!
`ssh user@dongsheng.org ‘/bin/bash -i’
来源:oschina
链接:https://my.oschina.net/u/735755/blog/79189