CentOS – GNU Screen refuse to start on non-root user

After a system upgrade, I couln’t start anymore screen as a regular user, only as root.

After a system upgrade, I couln’t start anymore screen as a regular user, only as root. Which is not okay…

Usually I’ve had trouble with wrong permission on /dev/pts/ but not here, screen justs silently exit.

[user@nsxxxxx ~]$
[user@nsxxxxx ~]$ screen
[screen is terminating]
[user@nsxxxxx ~]$
[user@nsxxxxx ~]$

After a lot of strace and duckduckgoing around, I found that it was due to the mount parameters in /etc/fstab

To test, I’ve just commented the entry in /etc/fstab and reloaded my server

[root@nsxxxxx ~]# mount | grep devpts
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
[root@nsxxxxx ~]#
[root@nsxxxxx ~]#

Permission are not okay, and most importantly, the GID is not set to the TTY group ( 5 )

[root@nsxxxxx ~]# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/md2 / ext4 errors=remount-ro 0 1
/dev/md3 /home ext4 defaults 1 2
/dev/sda4 swap swap defaults 0 0
/dev/sdb4 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
#devpts /dev/pts devpts defaults 0 0  <<<<<< Commented entry
[root@nsxxxxx ~]#

After a reload ( probably a remount should/could work ? )

[root@nsxxxxx ~]#
[root@nsxxxxx ~]# mount | grep pts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)[root@nsxxxxx ~]#

From my understanding, screen needs to allocate PTS for the user. That can be done if the process is owned by TTY group ( and the permission set accordingly  )

[root@nsxxxxx ~]# cat /etc/group | grep tty
tty:x:5: