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
$ cat /proc/sys/kernel/pty/max

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

  • join the tty group – mikeserv Oct 28 '15 at 14:42
  • @mikeserv still the same but groups doesn´t display tty in root and the other user I want to use .. – Ragyal Oct 28 '15 at 14:52
  • you need write access to /dev/ptmx. it should be enough to be in the tty group. if not, chmod it, or figure out why. – mikeserv Oct 28 '15 at 14:52
  • It seems that /dev/ptmx is not existing: chmod: cannot access "/dev/ptmx": No such file or directory – Ragyal Oct 28 '15 at 14:57
  • /dev/pts/ptmx then? weird. what system is this? are you using only bsd ptys? – mikeserv Oct 28 '15 at 14:58

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
  • 2
    Thanks! sudo chmod u+s /user/bin/screen + sudo chmod 755 /var/run/screen solved the problem. – Ragyal Oct 29 '15 at 8:30
  • After running sudo chmod u+s /usr/bin/screen, trying to run screen returns Directory '/var/run/screen' must have mode 755.. (That's where Ragyal probably got it from) – JeromeJ Feb 16 '17 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.