Sharing a screen session with another user

      3 Comments on Sharing a screen session with another user

GNU screen has builtin multiuser support that let’s you share a screen session with another user.

First, create a screen session named with an arbitrary name, e.g. ‘shared’, and attach to it:

[user1@pc ~]$ screen -S shared

To allow other users to use the session, you need to enable multiuser support (Ctrl-a :multiuser on) and add the specific user(s) you want to share your session with to the access control list (Ctrl-a :acladd user2).

If you try to attach to this session with a different user now, you might run into the following problem:

[user2@pc ~]$ screen -x user1/shared
Must run suid root for multiuser support.

To fix this, set the SUID bit on the screen binary:

[root@pc ~]# chmod u+s $(which screen)
[root@pc ~]# chmod 755 /var/run/screen

You also need to change the permissions of the /var/run/screen directory to 755, otherwise screen will complain when you create a new session.

You should be able to connect to the shared screen session now:

[user2@pc ~]$ screen -x user1/shared

If you run into chmod /dev/pts/2: Operation not permitted remember that a user is not able to manipulate the pty he is on when you run su - user (in contrast to using ssh user2@host).

Resources:
http://wiki.networksecuritytoolkit.org/nstwiki/index.php/HowTo_Share_A_Terminal_Session_Using_Screen
https://www.gnu.org/software/screen/manual/screen.html
http://aperiodic.net/screen/multiuser

3 thoughts on “Sharing a screen session with another user

  1. Pingback: HackTheBox / Backdoor | Berkay Guclu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.