Unable to open pty: No such file or directory

Posted by
Updated onJanuary 31, 2022

Not happy with your web hosting service provider?

Approx. read time : 2 min

The time you try login to the VPS from the node it shows error below.

Unable to open pty: No such file or directory

If you even try to access the VPS, via SSH, it will show error below

PTY allocation request failed on channel 0

To fix this issue there are 2 alternatives. Use any one which suits you. Perform the commands below as root on your main node.

Solution 1

vzctl exec veid /sbin/MAKEDEV pty
vzctl exec veid /sbin/MAKEDEV tty
vzctl enter veid

Once set, use commands below.

vzctl enter VEID
rpm -qa | grep -i udev
rpm -qf /etc/udev/makedev.d/50-udev.nodes
rpm -e –nodeps udev-095-14.9.el5

Solution 2

Login to your main node and access file


Find for start_udev, below this line add

/sbin/MAKEDEV tty
/sbin/MAKEDEV pty

Restart your VPS & you are done.

My name is Neha Khanna, I work for MilesWeb.com. I am interested in posting content on various topics. I aim at posting informative articles that provide value to people.