VNC with hops multiple machine

1

I want to acces a remote machine that in inside another machine. I can ssh to it but can't see any in VNC viewer. That's the configuration.

external_ip port 3999 to internal_ip192 port 3999

internal_ip192 port 3999 forwards to internal_ip10 port 22

From local_machine:

ssh -i mykey -p 3999 ubuntu@external_ip
Connection done.

So if now I up vncserver running on port 5901, It's needed to forward this port to internal_ip192 and external_ip?

I tried to do this, but can't see any in VNC viewer:

ssh -i mykey -p 3999 -L 5901:localhost:5901 ubuntu@external_ip
(Connection done)

Does I need to open port 5901 on external_ip / internal_ip192 and forward this ports?

XcoreX1

Posted 2018-09-27T07:47:41.473

Reputation: 11

Answers

1

For one hop using an interim computer called interim.host, use the following procedure:

From your workstation:

$ ssh -L5900:localhost:5900 user@interim.host

From interim.host:

$ ssh -L5900:localhost:5900 user@remote.host

Finally connect your local VNC client to localhost:5900.

You may use this procedure to extend to as many hops as required.

harrymc

Posted 2018-09-27T07:47:41.473

Reputation: 306 093