1

I would like to remote my home computer(Linux) which doesn't have a public IP address.
I have a VPS which does have a public IP address.

I'm wondering if there's a way to create some kind of tunnel between my home computer and my VPS, so I can remote my home computer through my VPS. Something like this:

[home] ----persistent tunnel---[VPS]---<--connect---[Me]

SparedWhisle
  • 4,165

1 Answers1

2

You can do a reverse SSH from Home to the VPS by using something similar to:

autossh -M 10900 -fN -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R <VPS IP>:<VPS OPEN PORT>:localhost:22 <VPS USER>@<VPS IP>

You should use authentication via SSH Public Key, so your home computer will not ask password to estabilish the reverse tunnel, there are lots of web-sites that will teach you how to use this authenticatino method.

Then you can connect to home using VPS by using:

ssh -p <VPS OPEN PORT (SAME OF THE AUTOSSH)> <HOME USER>@localhost

Otherwise you can setup a VPN, but i think it's quite harder than this.

ErikM
  • 168