So, in theory I can log in as an admin user and have someone else log in as the same user or a different user over an SSH session and have both users attached to the same screen. In our case we have a rather complex environment setup and sometimes need remote assistance with it. How is this done? Do we both need to be the same user?


I understand you are aimed at an application for training, and although your question specifically states screen, let me suggest tmux.

With tmux you can create sessions, to which you can connect from several computers. I have only done it for the same user, so I do not know if it is possible to attach to sessions created by a different user.

You can have even several sessions on the same machine. For example, you may run the following command to create a new session. Run it with the same user your pupil is going to use. You can name the session whatever you want (I chose lesson01).

$ tmux new-session -s lesson01

Then, your padawan logs onto your machine over SSH using the same user as before. He may then run this command to attach to your session.

$ tmux attach-session -t lesson01

Whatever you time in one terminal, should automatically appear on the other. Also, with tmux you split the terminal in two (leaving one for you, and the other for your pupil).

I hope you find this useful for education and training purposes. Again, sorry not to answer how it is done with screen.

| improve this answer | |

An alternative approach to redirect the output of your terminal to a terminal of some other user is:

Doing at your terminal:

mkfifo foo; script -f foo

Use the who command to see the terminal of the other user; and on another terminal of yours, redirect the output to the terminal of the other user, as root:

cat foo >> /dev/pts/2
| improve this answer | |

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