0

I have a server in my private network 192.168.178.20 which hosts a (local/only on the server) virtual ethernet adapter 192.168.122.1.

I want to access 192.168.122.1 from my local machine - what would be the right command to ssh tunnel me into 192.168.178.20 ?

I want to access port 5901 on 192.168.122.1 to open a VNC connection

1 Answer 1

-2

I have a server

A what server? A VNC server? An SSH server?

in my private network 192.168.178.20

that's a weird term, 'private network' maybe you mean your LAN (not a VPN for example).

which hosts a (local/only on the server) virtual ethernet adapter 192.168.122.1.

Do you mean a virtual machine made in e.g. virtualbox or vmware has created a computer with a virtual ethernet adaptor and IP. And the server is bound to that IP. Ultimately the server is bound to an IP. It doesn't matter if that ethernet adaptor is virtual or not. (though i'd be curious how you made a virtual ethernet adaptor without a virtual machine, if you did). You could be clearer there, if you're to talk of a virtual ethernet adapter.

I want to access 192.168.122.1 from my local machine - what would be the right command to ssh tunnel me into 192.168.178.20 ?

Well, suppose your local machine is 192.168.11.2 Why do you want to SSH within your LAN. Is encryption important within your own LAN?

You'd do ssh [email protected]

I want to access port 5901 on 192.168.122.1 to open a VNC connection

Well, you have to start an ssh server on 192.168.122.1

And you have to SSH to that machine `ssh 192.168.122.1'

And then, once you have that sorted out.

You go to the ssh client machine and do

SSH -L 5901:127.0.0.1:5901 192.168.122.1

And then you start VNC client on the machine with the SSH client,

and you connect VNC to 127.0.0.1:5901 (that 5901 is determined by the first 5901 in the command)

The connection will then go through / tunnel through, the SSH connection

When it reaches the SSH server, It will then get forwawrded to 127.0.0.1:5901 So it will remain on the server, and get sent to port 5901 on the server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .