Sharing GNU sessions

GNU Screen have a very useful feature: sharing the same same session with multiple terminals.

Setting up a shared screen session

The following command sequence sets up a shared screen session named ‘shared’:

screen -d -m -S shared

Listing screen sessions

screen -ls
There is a screen on:
	8632.shared	(Detached)
1 Socket in /var/run/screen/S-pkb.

Attaching an existing session

screen -x shared

 

Doing the same… with different users

First the bad news : screen sharing with another account requires that the screen command be suid root. That a strong security risk so do it only if you are on a non-critical environment. When it’s done, simply start a new session as usual, then:

Enable multiuser support

Ctrl-A
:multiuser on

Add the user to join your session

Ctrl-A
:acladd foobar

Now the user foobar can join the session shared launched by the user user like this screen -x user/shared.

Leave a Reply

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