I have a friend who is connected via SSH, and I would like to view his screen to see his progress in our project and what are the things he's doing. It's like spying on him.

I would like to know how to do this. Currently I can only view the screen that is created by screen command, but how about those screen sessions created during connecting via SSH?

I really need some advice. Thanks!


If I understand you correctly I believe I have a script that does what you want. See below link :

SSH Bind Address Script

You will need to have password authorization turned off and be able to connect via public key exchange as well as have TCP Forwarding turned on (on the server side, i.e. your friend's computer) for this to work.


You can do the quick just do the following 1 liner (you will still need TCP Forwarding : on). The script is just a connivence since I don't want to keep typing all this in every time when I'm trying to connect to multiple severs or just bind to multiple ports on the same machine.

ssh -p $port -N -L $local_port:$remote_port $user@$ip
  • $port is the ssh port the remote machine is listening on.
  • $local_port is the local port on your computer you are going to connect to.
  • $remote_port is the remote port on your friends computer you will bind your local port to.
  • $user is the username to use for the ssh connection.
  • $ip is the ip address ssh will use to connect to.

After you've connected whatever you put for $local_port will be a tunnel (through ssh) to your friends remote computer at whatever you put for $remote_port.

So if you wanted to view your friend's screen you can point your VNC viewer at$local_port ($local_port is whatever you put for $local_port above).

This assumes that your friend has a VNC server running in the first place of course.

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.