Allow access to Linux Console

Suppose one is running an SSH session into a GNU/Linux box of a client and he asks you to see "what you are doing". How can you allow this other party to see what's going on in your session?


You could try using the "screen" command. This will allow you to run a multiuser session which 2 users can connect and share. First you'll need to set the suid bit. screen comes with it turned off, and it is necessary for multiuser mode:

sudo chmod +s /usr/bin/screen
sudo chmod 755 /var/run/screen

The first user connect, running

screen -S shared

The "-S" just gives the session an easy to use name. To allow multiuser access, use "CTRL+A" to run screen commands:

CTRL+A
:multiuser on
:acladd otheruser

When otheruser connects over ssh, he just needs to run

screen -x firstuser/shared

to join the session


Worked like a charm.

I also received an offline hint from a guy I chatted with proposing an alternate solution:

user wishing to share uses "w" to view where the other guy is working...

# w
 16:27:10 up 30 days,  8:37,  3 users,  load average: 0,99, 0,94, 0,89
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1     -                26Apr10  9days  0.04s  0.01s login -- root
root     pts/0    192.168.2.25     15:31   54:29   0.04s  0.00s script
root     pts/1    192.168.2.235    16:21    3:29   0.05s  0.05s -bash

now that we now were the other guy is working, we issue this:

# script | tee /dev/pts/1 

This method has disadvantages to the one proposed by katriel, as it is one way only and if you forget to use exit to break the connection, the other pts keeps receiving data even if the user logs out of it, being a potential security threat. But I thought it was worth mentioning.

Anyway thanks to katriel and the others.


Just run a VNC server on your workstation and let him connect to that. Cheap and easy :)