How to use “screen” to mirror screens between different users

The screen command is usefull for mirroring a screen between two terminal sessions.

1. In the home directory of user1 create the .screenrc file that has the following lines.

Login “user1”

$ vi .screenrc
multiuser on
acladd user2

2. As root change the permissions of /usr/bin/screen to 4755. This will add the SUID bit.

Login “root”

$ chmod 4755 /usr/bin/screen
$  l /usr/bin/screen
-rwsr-xr-x 1 root root 308896 2007-05-03 07:44 /usr/bin/screen

3.  As user1 run “screen”

Login “user1”

$ screen

4. From a different terminal as user2 run “screen -x user1/”. The / is necessary

Login “user2”

$ screen -x user1 /

Now both users can see the same screen and either can type and it is visible to each user.

Leave a Reply

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

Please validate : * Time limit is exhausted. Please reload CAPTCHA.