I want to proxy my home SSH-server over a VPS from Dedipath, but I don't know how it works. because I already tried it with many tcp proxies and they didn't work.
My VPS has Debian 10 and my home server too.
I want to proxy my home SSH-server over a VPS from Dedipath, but I don't know how it works. because I already tried it with many tcp proxies and they didn't work.
My VPS has Debian 10 and my home server too.
If I suppose your home-server is behind a NAT and your VPS has a public internet IP, you can use ssh remote-tunnel options for this:
useradd -m tunneltovps
sudo -u tunneltovps -i
ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... tunneltovps@myhome-server
* on your VPS server, create a dedicated user for the tunnel with home-server, and copy the public key to `~/.ssh/authorized_keys`:
```shell
useradd -m myhomeserver
sudo -u myhomeserver -i
mkdir .ssh
echo ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... tunneltovps@myhome-server >> ~/.ssh/authorized_keys
sudo -u tunneltovps -i
ssh -R 1234:localhost:22 my-vps-server
Now, on your VPS the port 1234 should be listening (on localhost) and tunneling to your ssh server on myhome-server
you can test to connect to your home-server from any machine connected to internet by using the VPS as a jumphost:
ssh -J my-vps-server -p 1234 localhost
Alternatively, if you want to expose publicly the ssh server of my-home-server, you could use this command to create the tunnel on the home-server:
ssh -R 0.0.0.0:1234:localhost:22 my-vps-server
Now your home-server could be reachable directly (without jumphost) with:
ssh -p 1234 my-vps-server