[X-Unix] Port Forwarding ssh using -R option
Daniel Morrison
dmorriso at eagle7.org
Thu Feb 5 15:56:19 PST 2004
The -R is to forward from a port on one machine to another machine. But
it won't work unless you can SSH to your router from your Mac.
So, if I had my Mac, a Linux gateway, and an outside client machine, it
might go something like this:
1) I ssh from my Mac to the gateway, telling it to redirect any connection
to port 1025 on gateway to port 22 on the mac.
2) I keep this connection open, as the port forwarding tunnels through
this secure connection.
3) When, from the client machine (or any other machine), I ssh to port
1025 on gateway, it is forwarded to port 22 on the Mac and I connect.
Note that I could do the same thing with http and port 80, etc.
>From the man page:
Specifies that the given port on the remote (server) host is to
be forwarded to the given host and port on the local side. This
works by allocating a socket to listen to port on the remote
side, and whenever a connection is made to this port, the connec
tion is forwarded over the secure channel, and a connection is
made to host port hostport from the local machine. Port forward
ings can also be specified in the configuration file. Privileged
ports can be forwarded only when logging in as root on the remote
machine.
So, unless you can SSH to the router, this won't work. However, ussually
broadband routers have a setting that allows forwarding of a port at the
router to a port on an internal machine. So you should be able to forward
router port 22 to Mac port 22 using that, if your router supports it.
Good Luck,
Dan
On Thu, 5 Feb 2004, 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
>
>
> ----------
> Check out the Mac OS X email list FAQ
> http://www.themacintoshguy.com/lists/X.html
>
> To unsubscribe, E-mail to: <X-Unix-off at lists.themacintoshguy.com>
> To switch to the DIGEST mode, E-mail to <X-Unix-digest at lists.themacintoshguy.com>
> Need help from a real person? Try. <X-Unix-request at lists.themacintoshguy.com>
>
> ----------
> $14.99 Unlimited Nationwide Mac Dialup and Mac Web Hosting from your Mac ISP
> Serious Mac Internet Solutions From NineWire! http://macinternetaccess.com
>
> DVIator | Run Dual ADC displays on your G4 or just one on an older Mac!
> Dr. Bott | <http://www.drbott.com/prod/DVIator.html>
>
> Support | Support this list by clicking here before you buy!
> this List | http://www.themacintoshguy.com/support.html
>
> OS X News, Dr.Mac, Forums, Tutorials, Tips, Hints, FAQ?s - http://www.osxfaq.com
>
>
>
--
Dan Morrison http://www.eagle7.org
dmorriso at eagle7.org AIM: EaglVII
More information about the X-Unix
mailing list