Skip to content

Instantly share code, notes, and snippets.

@lucsh
Created September 8, 2021 13:26
Show Gist options
  • Save lucsh/a1c69c7ba179051c5305312d09e8f68f to your computer and use it in GitHub Desktop.
Save lucsh/a1c69c7ba179051c5305312d09e8f68f to your computer and use it in GitHub Desktop.

First, create a new session:

screen -d -m -S multisession

Attach to it:

screen -r multisession

Turn on multiuser support:

Press Ctrl+a and type

:multiuser on
:acladd USER  #use username of user you want to give access to your screen

Now, Ctrl+a+d and list the sessions:

screen -ls

You are going to get a message like:

There is a screen on:

    4791.multisession   (Multi, detached)

You now have a multiuser screen session. Give the name multisession to acl'd user, so he can attach to it:

screen -x youruser/multisession

And that's it.

The only drawback is that screen must run as suid root. But as far as I know is the default, normal situation. Another option is to do screen -S $screen_id -X multiuser on, screen -S $screen_id -X acladd authorized_user Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment