Jun
29
2005

OpenSSH Port Forwarding

Don't you love when it all comes up Milhouse?

(Add / View Comments) (0)Wednesday, June 29, 2005 - 11:49:54 pm
(Posted Under: Geek)
Tonight I played around a bit with forwarding Samba connections (Windows File Sharing) over a ssh tunnel. Instructions on how to do it are here. Interesting that you can do it, I'd always figured that UDP ports 137 and 138 were required. Also interesting reading up on the creating a second network connection in Windows XP, I'm sure I've wanted to do that before, and not been able to succeed - ah, yes, I think when I was playing around with IPSEC VPN's to work.

The downside - having to bind the local ssh forwarded port to a specific address. Sure, PuTTY can do it - but I hate PuTTY. [wink] After playing around and seeing it work, I got interested in binding forwarded ports to specific addresses again, and the lack of being able to do it with OpenSSH. First time around was pre the VPN at work, where I setup a complex set of scripts, to access the inside of the firewall (well, the parts I wanted to) remotely. Complex largely because I had to bind the forwarded ports to the loopback on a bunch of non matches port numbers, and then emulate them being bound to local ports on different addresses with a complex iptables ruleset. Pretty fancy to actually get going, but fairly complex to do a relatively simple task.

So, I decided to hit the OpenSSH website and mailing list, to find out if it could be done yet. With little cofidence that 1) it could be and 2) I'd find any info on it. Call me a cynic, but I did. 4 posts and 5 minutes later, I hit this:

Changes since OpenSSH 3.9:
============================ 

* ssh(1) now allows the optional specification of an address to bind to 
  in port forwarding connections (local, remote and dynamic). Please 
  refer to the documentation for the -L and -R options in the ssh(1) 
  manual page and the LocalForward and RemoteForward options in the 
  ssh_config(5) manpage. (Bugzilla #413)

After 9 years on the web, I'm pretty spot on with assumptions on how hard something is going to be to fine. This time I was happily wrong. [smile] Took no time to find this - that since March 3, OpenSSH 4.0 has supported exactly what I want. Portage is syncing as I type. [wink] Now I've just got to see what version Cygwin is distributing as current.

I love when things come up Millhouse. [smile]

Switch Styles

About Style Switching.

!Weblog Index

May June 2005 Jul
SU MO TU WE TH FR SA
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

Categories

RSS FeedRSS Feed