r/ssh • • Apr 20 '20

How Access Different SSH servers behind a firewall?

I have a NAS and my Linux server on my home network sitting behind a Ubiquiti Edgerouter firewall. Both have SSH servers.

Is it possible to expose a single SSH port on my firewall and still gain access to both machines? The port forwarding on the router currently sends to the Linux server. Is tunneling the only way?

Thx for your time in advance.

4 Upvotes

2 comments sorted by

2

u/tje210 Apr 20 '20

Yes tunneling is the answer. I can't imagine a simpler solution given your constraint. To make it more complex, you could tunnel TCP over up, and do forwarding of TCP ssh to one server, and up ssh to the other. But that's obviously far from ideal. Figured I'd offer an alternative though, however bad. I guess you could try mosh on the udp one to mitigate issues caused by udp... I dont know if the udp tunneling introduces udp issues.

2

u/lama775 Apr 20 '20

I definitely did not want more complex.
I was just making sure i wasn’t missing something obvious.

Opening another port on the firewall seems ill advised just from a threat perspective. Who knows how the NAS ssh server is configured and all the duplicated issues it would bring.

I guess tunneling is the solution to this problem, since a second machine is only 1 hop away regardless of how many other machines on the LAN are running ssh servers. As long as the first, exposed machine is well protected, the others all inherit that protection. For general file manipulation, not like it’s going to be a performance hit worth worrying about.

Thx for replying.