4

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

13
  • join the tty group
    – mikeserv
    Commented Oct 28, 2015 at 14:42
  • @mikeserv still the same but groups doesn´t display tty in root and the other user I want to use ..
    – Ragyal
    Commented Oct 28, 2015 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
    Commented Oct 28, 2015 at 14:52
  • It seems that /dev/ptmx is not existing: chmod: cannot access "/dev/ptmx": No such file or directory
    – Ragyal
    Commented Oct 28, 2015 at 14:57
  • /dev/pts/ptmx then? weird. what system is this? are you using only bsd ptys?
    – mikeserv
    Commented Oct 28, 2015 at 14:58

1 Answer 1

4

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
  • 2
    Thanks! sudo chmod u+s /user/bin/screen + sudo chmod 755 /var/run/screen solved the problem.
    – Ragyal
    Commented Oct 29, 2015 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
    Commented Feb 16, 2017 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .