Reverse SSH (or other tunnel/VPN)
Michael Hipp
Michael
Tue Dec 21 15:57:03 PST 2004
Net Llama! wrote:
> On the box behind the NAT, (we'll call it localhost) issue this command.
> Your random remote, internet facing box will be called foo.bar.com:
> ssh -R 3500:localhost:22 foo.bar.com
>
> The above command assumes that you have the same username on both boxes.
> If not, adjust to include a '-l' option for foo.bar.com. Once you issue
> that command and are ssh'd onto foo.bar.com, issue this command:
>
> ssh -p3500 localhost
>
> The above command assumes that you have the same username on both boxes.
> If not, adjust to include a '-l' option for your NAT'd box (localhost).
> Once you do that, you'll be ssh'd onto the NAT'd box (localhost).
>
> I usually run the first command inside a screen session so that its out of
> the way, and semi-transparently maintains the connection. Now as long as
> you don't log out from the first command, you can ssh into foo.bar.com and
> issue that 2nd command and get into your NAT'd (localhost) box from
> anywhere.
Thanks, Lonni.
Looks like it might be worth using 'autossh' to make sure the first
tunnel never dies since I have no direct way of restarting it. The host
will be on satellite Internet which is anything but reliable.
Michael
More information about the Linux-users
mailing list