centos4.8升级到39内核的时候不能远程ssh

旧街凉风 提交于 2020-05-05 19:53:40

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’

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!