GNU Screen > Remote controlling software >
Written for PCLinuxOS 2007, though it was updated 2009-04 so it should be the same as PCLinuxOS 2009.
Log in as your regular user, and do:
\screen -S shared
Then do:
^a : multiuser on ^a : acladd user2
Log in as your other user:
\screen -list user/
Gives:
No $SCREENDIR with multi screens, please.
Fail.
Ok, try:
\screen -x user/shared
Gives:
Cannot open your terminal '/dev/pts/1' - please check.
I made user2 a member of the 'audio' group, and now I get:
No $SCREENDIR with multi screens, please.
Fail.
I can't unset SCREENDIR .. I have no clue how to troubleshoot this.
Research ∞
Notes ∞
https://news.softpedia.com/news/GNU-Screen-Tutorial-44274.shtml
- Sharing a screen session
To share a terminal with one or more users, you have to:
1. Set the screen binary setuid root:
\chmod +s /usr/bin/screen
2. Login as root and start a screen session and give it a name:
\screen -S sessionName
3. Enable screen's multi-user access function by pressing Ctrl+a then :multiuser on (to type :, press shift+;)
4. Grant permissions to the second user by pressing Ctrl+a: acladd username, where username is the Unix user for the second user.
5. Ask the second user to connect to your computer through SSH and type
\screen -x root/sessionName
- Multiuser mode
This is one of the more advanced features of screen. It also happens to pose a bit of a security risk.
We'll use a very simple scenario for this one. Let's say Jake wants to share access to a screen session with Bob. Jake & Bob both have accounts on the system.
1. In order to enable multiuser mode the screen binary must be setuid for root.
\chmod u+s /usr/bin/screen
2. Jake starts a screen session.
\screen -S shared
3. Jake must enable multiuser mode.
CTRL+a : multiuser on
This could be added to ~/.screenrc to have it enabled for all sessions, but case-by-case is probably safer.
4. Jake must add Bob to the access control list for his session.
CTRL+a : acladd bob
5. Bob lists the screen sessions that Jake has available.
\screen -list jake/
There are several screens on:
1951.pts-1.testbox (Private)
1994.shared (Multi, attached)
2 Sockets in /tmp/screens/S-jake.
This shows us that Jake has 2 sessions. The second session named "shared" is a multiuser session & Jake already has it attached.
6. Bob attaches Jake's multiuser session.
\screen -x jake/shared
Bob could also connect using the PID. [ 1 ] no instructions were provided for connecting using the PID.
7. Jake can check to see if Bob is connected to his session.
CTRL+a *
This brings up a list of users in a screen session.
term-type size user interface window
---------- ------- ---------- ----------------- ----------
xterm 80x24 bob@/dev/pts/11 0(email) rwx
linux 80x24 jake@/dev/tty1 0(email) rwx
[Press Space to refresh; Return to end.]
8. Jake can boot Bob from his screen session.
CTRL+a : acldel bob
Bob is immediately disconnected and sees...
[remote detached]
(and is returned to his shell prompt)
Footnotes
| ^ 1 | no instructions were provided for connecting using the PID. |
Last updated 2019-12-06 at 23:17:15

ported