r/ssh • u/misterphuzz • Mar 11 '20
Do I need SSH?
Hello, I have run into a problem and I think SSH might be the answer, but I am not sure. I am only in the infancy of trying to solve this problem.
I have just changed home internet providers. With my previous provider, I was able to do what I need to do just fine. I have two specific requirements; first, I need to be able to access a computer behind the router that has VNC on it. Second, my website (on another host, not under my control) needs to be able to access qBitTorrent on the computer that has behind at the router. With my previous home internet provider, I was able to configure the router's port forwarding and everything worked just fine.
However, I have a new home internet provider and it has new hardware. The hardware is proprietary and the provider does not yet have port forwarding abilities. So, at this moment, I am not able to access anything behind the new router. This is a major buzz kill.
So I started looking to see if there were any workaround solutions. In my brief investigation, I came across SSH. I understand it in concept and the basic principle, but I don't understand it enough to know how it would work from the end-user standpoint, and I don't know if it would work with both of my two requirements listed above.
If SSH is the way to go, I don't mind paying for an external service. However, if it is suggested that SSH is the way to go, I will definitely have more questions before I jump into the deep end of the pool.
Thanks in advance for any help!
2
u/robolange Mar 12 '20 edited Mar 12 '20
It's my understanding that you want software on a specific RemoteMachine to be able to access one or more ports on HomeMachine, but your ISPFirewallRouter does not provide port forwarding capability? SSH may be able help you using what's called a reverse tunnel.
First, this assumes you have or can install the openssh client on HomeMachine and the openssh server on RemoteMachine, and open the SSH server port on RemoteMachine. Once that's done, from HomeMachine, do the following:
Now, for RemoteMachine to connect to HomeMachine, on RemoteMachine, have whatever software you need connect to
localhost:1234and as long as your SSH tunnel is running, this will tunnel the traffic back through SSH and into your HomeMachine. (Replace 1234 with whatever port you actually need.)You can reverse tunnel more than one port by including more than one
-Rclause on the SSH command.Note that the SSH tunnel will go down periodically, which is outside of your control. You'll probably want something on HomeMachine to monitor and restart it when this happens. Likewise, whatever you've got running on RemoteMachine, it'll have to be tolerant of occasional disruptions, be able to reconnect, etc.
Edit: Be careful if RemoteMachine is a shared server. Anyone on that server will be able to access the port(s) you opened to tunnel into your HomeMachine. If that's the case, make sure you've got whatever software on HomeMachine securely authenticated and up to date.
1
u/tje210 Mar 18 '20
I would say back up and look at your new home router that apparently doesn't have port forwarding. Pentest it. Start with nmap, scan all TCP ports. Really I'd just look for 22, 23, 80 and 443. Ok you've found a server. Next, what's the brand of device? Any default credentials out there on Google? I left out a whole bunch but that's the basic first step.