« Moving a window above the top bar in Gnome 3 classic shellXbox 360 Bluetooth Controller on Centos 7 Linux »

Connecting to x11vnc through an ssh tunnel, both ways

11/05/17

  09:23:00 am by wdawe, Categories: General

Enter the following command on your local machine (machine_A):
ssh user@remote_machine -L 5900:localhost:5900 "x11vnc -display :0 -noxdamage"
then run vncviewer and use localhost as the server to connect to and you should see the remote machine's screen.

To do it in the other direction if you use x11vnc to connect outwards.
At a console prompt on the local machine (Machine_A) enter: vncviewer --listen (listens on port 5500 by default)
At a console prompt on the remote machine enter: ssh user@Machine_A -L 5500:localhost:5500 -N
And finally on the remote machine: x11vnc -connect localhost -display :0
and you should see the remote machines screen.

If you have a machine on the internet and you want to get ssh access to a machine behind a firewall, you can set up a straight ssh tunnel. It's a variation of second method

On the machine you want to access (Machine_A) you enter:
ssh -R 5301:localhost:22 user@machine_B -N
and on Machine_B
ssh user@localhost -p 5301 and you should see a login prompt from Machine_A
if you set GatewayPorts yes in /etc/ssh/sshd_config on Machine_B and you have access to port 5301 on Machine_B. You can also access Machine_A from another Machine
with ssh Machine_B -p 5301

No feedback yet


Form is loading...

Cool web tools, EEPC tips and Linux info. Browse around, I'm sure you will find something to interest you.

Search

  XML Feeds

Bootstrap CMS