Tips: System Administration

Sharing Your Console Screen

There are times when you need to have someone else in on your session. This is how to do this with the screen command in a console session. This could be very useful in showing someone remotely how to do something or just to have a second, third, forth eye of something your are doing. This is something we get to do quite often when teaching clients and colleague on the command line.

First you will need to make sure screen is installed. On Debian and Ubuntu just use apt-get

sudo apt-get install screen

When screen is installed we will start a named screen session. So login as the user that you will be sharing with the person(s) that will be in this sharing screen session. For example you would create a user on you system that you will be giving out to others. We will says this system user is ‘student’ for our example here.
This is assuming that you have created the ‘student’ user on your system. This will also check if your ssh login is working correctly for this user.

me@myserver:~$ ssh student@localhost 
student@localhost's password:

Now we can start a named screen session.

screen -d -R shared

Now someone else can connect to your system remotely and then include themselves into your session that we names ‘shared’. So from a remote machine that has a ssh client installed. You would first have them login to your server running the screen session.

ssh student@remoteserver

When logged in there is one final command.

screen -x shared

At this point both users will see the same screen. Now you can have any number of users login and do the same. It really is that easy.
When any user wants to leave but not kill the session. Typing CTRL-a d and you have exited the session. When finished with your screen session you just need to exit.

student@myserver:~$ exit
[screen is terminating]

To find out more about screen use your man command.

man screen

Have fun.