The scenario:CentOS linux running on OpenVZ (that is a VPS server) and have udev installed. You try to connect to the server with shh.
The problem:You get this annoying message: "PTY allocation request failed on channel 0"
The reason:udev has compatibility problems with OpenVZ. So when you have for example a CentOS system and you try to install ImageMagik the yum package manager also installs the udev package. This leads to problematic setup of the pty devices (/dev/pty, /dev/ptmx, etc) on boot.
The temporary fix:
The permanent fix:Make a script with the previous commands (excluding the ssh part) and call it from the /etc/rc.d/rc.local.
Hope this helps - once and for all :)