<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">That'll certainly come in handy, thanks :)<br><br>--- On <b>Sat, 1/12/13, Claude Felizardo <i><cafelizardo@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Claude Felizardo <cafelizardo@gmail.com><br>Subject: [SGVLUG] example .ssh/config for port forwarding<br>To: "SGVLUG Discussion List." <sgvlug@sgvlug.net><br>Date: Saturday, January 12, 2013, 12:08 AM<br><br><div class="plainMail">During the ssh tunneling presentation at the last meeting I mentioned<br>that I set up quite a few forwards when I connect from work to home.<br>Because I might open multiple connections I don't want to clutter my<br>screen with lots of bind errors because I have already created a<br>listener for the port so I have two aliases. The first just does a<br>simple connect, the
other sets up a slew of forward assignments so I<br>can access multiple devices at home. I can then open a web browser<br>and go to localhost:5001 to connect to my router for example. So<br>here's part of my .ssh/config file:<br><br>ForwardX11 yes<br>ForwardAgent yes<br>ForwardX11Trusted yes<br><br>Host home<br> Hostname my.ip.at.home<br> Port 5022 <-- use non standard<br>port for ssh<br><br>Host home-forwards<br> Hostname my.ip.at.home<br> Port 5022 <-- use non standard<br>port for ssh<br> # forward connections to TiVos<br> LocalForward 5052 10.5.1.52:80 <- TiVo's have
static IP's so I<br>just add my base port number<br> LocalForward 5053 10.5.1.53:80<br> LocalForward 5054 10.5.1.54:80<br> # forward router<br> LocalForward 5001 10.5.1.1:80 <-- connect to router<br> # forward voice<br> LocalForward 5002 10.5.1.2:80<br> # forward wireless router<br> LocalForward 5004 10.5.1.4:80<br> # forward webmin<br> LocalForward 5010 localhost:10000<br><br> # forward voice<br> LocalForward 5254 10.5.1.254:80<br><br># file server<br> LocalForward 5100 10.5.1.10:80 <-- web server<br> LocalForward 5122 10.5.1.10:22 <--
ssh<br> LocalForward 5110 10.5.1.10:10000 <-- webmin<br><br># hp color printer<br> LocalForward 5211 10.5.1.21:80<br><br># ReadyNAS<br> LocalForward 5200 10.5.1.20:80<br> LocalForward 5222 10.5.1.20:22<br> LocalForward 5243 10.5.1.20:443<br><br># naspro<br> LocalForward 5300 10.5.1.30:80<br> LocalForward 5322 10.5.1.30:22<br> LocalForward 5343 10.5.1.30:443<br><br><br>As you can see this would have required a horrendously long list of<br>-L lport:rhost:rport options.<br><br>Check the man page for ssh. Make note of the difference between -L<br>which opens ports on the local side vs -R which opens ports on the<br>remote side.<br><br>I'll have to give the -D option a try when I get a chance.<br><br>Claude<br><br></div></blockquote></td></tr></table>