Tuesday, July 21, 2009

FIX : Unable to open pty: No such file or directory

While trying to SSH or enter into a VPS from the node, you may get the following error :

Unable to open pty: No such file or directory

or

root@tip~]# vzctl enter 900
enter into VE 900 failed
Unable to open pty: No such file or directory

There is a temporary and permenant fix for this issue.

Temporary Fix :-

Execute the following commands from the node

vzctl exec VEID /sbin/MAKEDEV pty

vzctl exec VEID /sbin/MAKEDEV tty

vzctl enter VEID

Where VEID is the VPS id.

Permanent Fix :-

First temporarly fix the issue and enter into the VPS.

1) vzctl enter VEID

2) Edit the file /etc/rc.sysinit of the VPS

vi /etc/rc.sysini

3) Search for the line /sbin/start_udev and comment it

#/sbin/start_udev

4) Add the following two lines under /sbin/start_udev

#/sbin/start_udev
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty
Logout from your VPS (Ctrl d)

5) Reboot the VPS and you are done!

vzctl restart VEID