Sharing a screen session

Whenever you need to share a terminal with someone–whether it’s because you’re working from home and need to collaborate with a coworker, or you’re pair-programming and taking turns to edit code–the ability to share a screen session can be invaluable.

If your guest is not able to attach to the screen instance after setting up session sharing using the steps below, please make sure that the screen binary is suid root:

sudo chmod +s /usr/bin/screen

From the screen man page:

Screen must be installed as set-uid with owner root on most systems in order to be able to correctly change the owner of the tty device file for each window.

There are some security implications to this which I don’t claim to understand, so take care not to share any screen sessions with the shifty-looking fellow sitting across from you on BART.

Let’s say that ekashida wants to share a session named toranosuke with ailuvyou2:

ekashida creates the screen session:
screen -S toranosuke

ekashida activates multi-user mode from within the session:
<Ctrl-A> :multiuser on

ekashida adds ailuvyou2 to the acl (access control list):
<Ctrl-A> :acladd ailuvyou2

ailuvyou2 can then attach like so:
screen –x ekashida/toranosuke

You can list all the users attached with:
<Ctrl-A> *

That’s really all there is to it. You can modify the ACL to restrict write-access and so on, but I haven’t really ever needed to do this. More information here.

Have fun!

Advertisement

About Eugene Kashida
I tell browsers what to do.

One Response to Sharing a screen session

  1. Pingback: Reverse SSH Tunnel « Eugene Kashida

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.