'How to Enable Security for forwarded ports?
I have two hosts, homehost, and digitalocean host. I want to access my homehost remotely via ssh. Homehost is behind a firewall with a dynamic IP. I am using reverse proxy, to initiate a connection from homehost to digitalocean host. By Running this on the homehost:
ssh -R *:1234:localhost:22 -i "~/path/to/privatekeyfile" root@digitalocean_host
This way, I can login to my digital ocean host via the private key pair file, and then ssh to port 1234 on localhost to connect to my homehost from anywhere outside the network.
Now I forwarded the port 1235 to port 1234 on the digitalocean host by doing this.
ssh -L *:1235:localhost:1234 root@localhost
This way, I can connect to my homehost from outside the network, by:
ssh useronhomehost@digitaloceanhost -p 1235
However, this does not depend on any keypair validation so my homehost is completely open to attacks. How can I enable a key-pair authentication for port 1235 of my digital ocean host?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
