Tuesday, April 06, 2010

Share GNU screen sessions with a different user

Here's something cool you can do with screen. Share a screen session with multiple terminals. "screen -x". Of course, this only works if you're using the same user.


Let's say you want to do some cooperative debugging with another username. Simple:

1. Set screen setuid flag:
chmod +s screen

2. Start a new screen sessions:
screen -S mihai

3. Set multiuser
Ctrl-A
:multiuser on

4. Add the user to join your session to the ACL list:
Ctrl-A
:acladd jimbo

5. Now connect as jimbo and join cmihai's session (called mihai):
screen -x cmihai/mihai


Now you can share you screen session with that user :-).