Score:2

Is the root user able to administer screen for other users?

in flag

We're trying to rewrite a draconian screen session killer for users who leave their screen sessions up for an inordinate amount of time and have in some way or other circumvented our session timeouts.

The current method is to find the pid for screen and kill it, it it looks like the screen program is written in a way that you can hook into other users sessions, but when I try to do anything as root, the screen directory is a different directory. Guessing this is for security reasons, but is there anyway to intentionally override this so that I can just do something like screen -r somedude/33333 -d -X quit? as root?

Score:5
tz flag

Standard screen instances are singleuser, i.e. each instance can only be accessed by the user who creates it.

To allow multi-user screen instance, you may want to add these commands:

multiuser on
addacl root,<user1>,<user2>,...

to your global screen config, i.e. /etc/screenrc.

Every screen instances after this should be multi-user screen, i.e. can be attached by another users specified in addacl; except if overriden by user-specific commands.

You can list user screens with

$ find /var/run/screen -type s
/var/run/screen/S-<user>/<pid>.<tty>.<host>

and attach to another user's screen with

$ screen -d -r <user>/<pid>

Check man screen, Customization section for more info about screenrc.

Note that each user may also add their own user-specific screenrc commands in $HOME/.screenrc file, therefore disabling multi-user screen for their user.

meuh avatar
in flag
Note that users can move the socket anywhere by setting env var `SCREENDIR=/some/dir` before running screen. To find them all you can do `ss -l -A unix_stream`, then pass each found filename through `sudo lsof` to check the command using them is screen.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.