[X-Unix] Port Forwarding ssh using -R option

Bill Vinson mailing_lists at vinsonweb.com
Thu Feb 5 15:58:13 PST 2004


If your router will handle it, port forward another port to 22 on the 
mac.  This works like the following:

Router (PUBLIC_IP 22) -> Xandros Linux (PRIVATE_IP 22)
Router (PUBLIC_IP 1022) -> Mac (PRIVATE_IP 22)

So you still hit fakedns.dyndns.org just with different port numbers.  
However, this all depends on the router supporting port forwarding.

For ssh, -L is what you want.  For example,

ssh -L $ANY_PORT:$PRIVATE_IP:22 $PUBLIC_IP

Then open a new terminal and ssh -p $ANY_PORT username at localhost

This can become much more sophisticated, but this is just an example.

Bill

On Feb 5, 2004, at 6:19 PM, Our Pal Al wrote:

> At least I think the -R option is what I want.
>
> I've already got my home Mac listening to ssh on 22 as normal but 
> moved it
> behind a wireless router last night (doing ddns so I can still always 
> reach
> it from outside) and want to be able to ssh into my mac and my Xandros 
> linux
> box at will. I want to map port 22 on the router to the linux box and 
> then
> change the mac to listen to another port and I'll append that port # 
> when I
> ssh to it.
>
> Or maybe I'll do it the other way around once I figure out how to get 
> ssh to
> listen on another port. Once I've got the right syntax down I should 
> be able
> to change either but I can't get -R to work. Or is this even really the
> option I want? How can I get ssh to listen on another port? Right now 
> I hop
> from the mac to the linux box but I'd like to eliminate a second step 
> in
> getting to either.
>
> - opa



More information about the X-Unix mailing list