5

I set up a Reverse SSH tunnel from my home computer to my work server:

ssh -f -N -R 19999:localhost:22 remoteuser@server

To connect to my home computer I have to first log in to the server and then from there log in to my home computer:

otheruser@othermachine$ ssh remoteuser@server
remoteuser@server$ ssh -p 19999 homeuser@localhost

But I want to be able to skip one step and connect directly through port 19999, something like:

otheruser@othermachine$ ssh -p 19999 homeuser@server

I'm not that familiar with iptables and I'm have been reading but it seems so confusing just to open a port. I'm pretty sure that I need to add a rule to iptables, but is there anything else that I need to do?

The server is RHEL 6 and my home computer is Ubuntu 14.04

1 Answer 1

3

In addition to iptables, you also need to use the -g option with ssh (GatewayPorts) and the server's config /etc/ssh/sshd_config has to have the GatewayPorts yes set.

2
  • SO it will be something like ssh -g homeuser@server right? Commented Aug 26, 2014 at 19:22
  • ssh -g -p 19999 homeuser@server, yes. Commented Aug 26, 2014 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .