dev/null, screen, and ptmx permission problems in xen vps

I got switched to a Xen VPS (debian linux) recently and discovered that some applications couldn’t write to /dev/null. It turns out that /dev/null was actually only readable and writable by root. I logged in as root and changed the permissions so that /dev/null was readable and writable by all.

chmod 666 /dev/null

This solved the problem.

I was still having trouble with some shell accounts, though, because no users could access screen (virtual terminals). The error message was that no PTYs were available. I solved this problem by giving these users access to the /dev/ptmx directory. This directory was initially only readable, writable, and executable by root, but I made it so that anyone in the admin group could read write and execute this directory.

chown root:adm /dev/ptmx

chmod 770 /dev/ptmx

If you want any user to be able to use screen, you will have to do this:

chmod 777 /dev/ptmx

Tagged with: , , , , , , ,
Posted in designing scalable systems