13

I login as root and can not see the screen created by other others using screen -ls. I think the root user could have way to access those screen, but I can't find useful options of screen:

Use: screen [-opts] [cmd [args]]
 or: screen -r [host.tty]

Options:
-4            Use IPv4.
-6            Use IPv6.
-a            Force all capabilities into each window's termcap.
-A -[r|R]     Adapt all windows to the new display width & height.
-c file       Read configuration file instead of '.screenrc'.
-d (-r)       Detach the elsewhere running screen (and reattach here).
-dmS name     Start as daemon: Screen session in detached mode.
-D (-r)       Detach and logout remote (and reattach here).
-D -RR        Do whatever is needed to get a screen session.
-e xy         Change command characters.
-f            Flow control on, -fn = off, -fa = auto.
-h lines      Set the size of the scrollback history buffer.
-i            Interrupt output sooner when flow control is on.
-l            Login mode on (update /var/run/utmp), -ln = off.
-list         or -ls. Do nothing, just list our SockDir.
-L            Turn on output logging.
-m            ignore $STY variable, do create a new screen session.
-O            Choose optimal output rather than exact vt100 emulation.
-p window     Preselect the named window if it exists.
-q            Quiet startup. Exits with non-zero return code if unsuccessful.
-r            Reattach to a detached screen process.
-R            Reattach if possible, otherwise start a new session.
-s shell      Shell to execute rather than $SHELL.
-S sockname   Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title      Set title. (window's name).
-T term       Use term as $TERM for windows, rather than "screen".
-U            Tell screen to use UTF-8 encoding.
-v            Print "Screen version 4.00.03 (FAU) 23-Oct-06".
-wipe         Do nothing, just clean up SockDir.
-x            Attach to a not detached screen. (Multi display mode).
-X            Execute <cmd> as a screen command in the specified session.

So which should I use?

8

Unless the screen session in question is created with multiuser on, you can't. Even if you set your SCREENDIR variable to point at the other user's socket directory, screen will just complain that you don't own the directory and quit when you try to use it.

Of course, you can simply su to the other user and use screen in the normal way.

1
  • 8
    After su to user, I commonly get Cannot open your terminal '/dev/pts/xx' - please check. The answer to that is here
    – harmic
    Oct 27 '16 at 6:31
4

You can see all screens on your machine via:

ls -laR /var/run/screen/

This will at least list the sockets with screen sessions and the user who owns it. If you have permissions to the socket it will list all the screens in use by that user as well.

from here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.