Timo Küfner
Timo Küfner

Reputation: 85

ssh connection between 2 clients over server

Hi my problem is i want to set up a ssh connection to my computer at home, but i am not able to do a dyn-dns routing because of my isp. I also got a vServer running.

My question now is: Is it possible to connect to the vServer from both my PC at home and my Laptop and somehow redirect the ssh, so i can ssh from my Laptop to my PC at home?

It is important, that they both first connect to the vServer as Clients.

Upvotes: 0

Views: 847

Answers (1)

user3392484
user3392484

Reputation: 1919

Yes: use remote port forwarding.

From the home box, establish an SSH connection to server with something like:

ssh -R 2222:localhost:22 user@server

This means: "have server listen on port 2222, and forward connections thereon to "localhost:22" as viewed by the home box.

From your laptop, ssh to port 2222 on the vServer:

ssh -p 2222 server

This will be forwarded to port 22 on your home box.

This assumes that you can connect to 2222 from your laptop (and/or can't connect to anything other than 22 from home). There are ways around those assumptions.

Upvotes: 3

Related Questions