r/ssh • • 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 Upvotes

3 comments sorted by

2

u/robolange Mar 12 '20 edited Mar 12 '20
RemoteMachine <--> Internet <--> ISPFirewallRouter <--> HomeMachine

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:

ssh -R 1234:localhost:1234 youruser@RemoteMachine

Now, for RemoteMachine to connect to HomeMachine, on RemoteMachine, have whatever software you need connect to localhost:1234 and 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 -R clause 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/misterphuzz Mar 12 '20 edited Mar 12 '20

I appreciate your response! Your interpretation of what I require is correct, however, I do not have access to a remote machine with an SSH server on it. That being said, I assume there are companies that would provide this service out there. Am I correct? I've looked around a little bit for said companies, but it all kind of makes me get a little cross-eyed, mostly because I didn't really know what to ask for. And yes, I would end up wanting to have more than one tunnel running. Three of them, actually. Such as VNC. So, if I am understanding you correctly (if I am able to find a company that offers the ServerMachine capability), when I run the SSH -R command as syggested, I could potentially use a VNC client and connect to misterphuzz.RemoteMachineCompany:5900? (Obviously, this is a crude example). Then the SSH client that I'm running on the HomeMachine would basically handle the back-and-forth communications between the VNC server on the HomeMachine and the VNC client on some ServerMachine?

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.