6

I use screen, and sometimes I'm forced to share it. How I can manage the active connections to my screen?

I would like to monitor connections and users connected, where they are and what they do. Also I would like to be able to kick them out.

Is this possible?

thanks.

1
  • You might want to mention this is GNU screen as this is confusing with the computer screen.
    – JavaRocky
    May 10, 2010 at 12:04

2 Answers 2

3

It's so simple!

Press Ctrl-A * to see the list of connected users to your screen session as well as the screen they're on.

The acldel command can be used to remove another user's rights to your screen session - this will kick him out as well.

0

You can tell which screen processes are linked to ttys by looking at the output of lsof: if a screen client process is connected to the screen interaction processes, then they will share tty devices. So for instance, with:

cas hax$ lsof -n | grep screen | grep tty
screen     1979  cas    3r    FIFO       14,2        0t0  7511093 /private/tmp/uscreens/S-cas/1979.ttyp3.calchas
screen     1979  cas    5r    VREG       14,2       2271     3155 /private/etc/ttys
screen     2298  cas    0u    VCHR        4,3  0t1443440 20004228 /dev/ttyp3
screen     2298  cas    1u    VCHR        4,3  0t1443440 20004228 /dev/ttyp3
screen     2298  cas    2u    VCHR        4,3  0t1443440 20004228 /dev/ttyp3
screen     2299  cas    3u    VCHR        4,3     0t3992 20004228 /dev/ttyp3
screen     2299  cas    4r    FIFO       14,2        0t0  7511449 /private/tmp/uscreens/S-cas/2299.ttyp3.calchas
screen     2299  cas    5r    VREG       14,2       2271     3155 /private/etc/ttys

We see that there is one interaction scree process, 2298, which has /dev/ttyp3 open. Process 2299 also has this tty open, but process 1979 does not access any tty. So you can infer from this output which child processes are talking to which interaction processes.

3
  • Is it possible that in my case your tty is called pts? screen 8011 admmarc 0u CHR 136,44 46 /dev/pts/44 screen 8011 admmarc 1u CHR 136,44 46 /dev/pts/44 screen 8011 admmarc 2u CHR 136,44 46 /dev/pts/44
    – Marc Riera
    May 10, 2010 at 16:18
  • Sorry about the parsing, I think it cannot be works.
    – Marc Riera
    May 10, 2010 at 16:19
  • 1
    @marc: If your linux runs udev -as it does- then it puts the pty slave nodes in /dev/pts. From your lsof output, process 8011 is the interaction screen process: you haven't listed any child screen processes of this interaction process. May 11, 2010 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .