Debian – “No more PTYs” when starting screen as non root-user

debiangnu-screennot-root-userpty

Whenever I try to start a screen-session as a non-root-user I get "No more PTYs." as a response.
Same command in the same directory as root works properly.

I tried the solution from this post but it won´t change anything:

$ ls /dev/pts  
$ cat /proc/sys/kernel/pty/nr
0
$ cat /proc/sys/kernel/pty/max
4096

Even unmounting and remounting doesn´t help:

$ grep /dev/pts /proc/mounts
devpts /dev/pts devpts rw,nosuid,noexec,relatime 0 0
$ umount devpts
$ mount devpts /dev/pts -t devpts -o mode=620

Related question of mine: Starting a minecraft server using screen doesn´t work properly

Best Answer

Very likely you cannot make screen use the BSD pseudo terminals because it is compiled to use a specific style of pseudo terminal (never both). There are two main flavors with variations:

  • a function (such as openpty) provides the names for the master and slave devices
  • the program searches through a list of master/slave pairs for an unused pair

In the latter case, you could do a

strings /usr/bin/screen

and find something like this: 0123456789abcdef (perhaps longer). If you do not find that, it is compiled for Unix98 pseudo terminals.

If you do find the string, it is possible that screen has to run setuid'd, e.g., to root (so that it can modify the permissions and ownership of the master/slave pairs).

Since the question implies that it works running as root, it is likely to work for ordinary users after something like

sudo chmod u+s /usr/bin/screen
Related Question