Forgot your password?
typodupeerror

SSH Tunnels How-to? 98

Posted by Cliff
from the what-encryption-worms-build dept.
The_Spider asks: "I periodically browse the net and check web-mail at work, when I have the opportunity. I was wondering if anyone had a nice walkthrough on how to set-up an SSH tunnel. I'm not 100% newbish to Linux but I don't know where to start. (I have a Fedora Core box at home for NAT & DHCP) I'm hoping to combine this for use with portable Firefox. I'm not to worried about security, but I love the notion of taking a portable and encrypted browser with me from place to place. Can Slashdot help?" While this might be a bit FAQ, I figure Slashdot anecdotes on the use of SSH tunnels might be a bit more user-friendly than say, the several task-specific HOWTOs one can find via a Google search. ALso, I'm sure that there are a few of you out there who have discovered interesting ways of using SSH tunnels, not covered by said HOWTOs. So, how are you using SSH tunnels, and can you explain them to those who have not yet discovered the value of their use?
This discussion has been archived. No new comments can be posted.

SSH Tunnels How-to?

Comments Filter:
  • The PuTTY win32 client documentation can be found here [earth.li]. It has a good intro to SSH as well.
  • Java VNC over SSH (Score:3, Interesting)

    by slthytove (771782) <james,m,allen&gmail,com> on Thursday January 19, 2006 @07:16PM (#14514142) Homepage
    This doesn't really address the author's original inquiry, but it is (what I would consider) an interesting use of SSH tunnels, in a readable tutorial. I set up something similar to "GoToMyPC" for my Dad, that allows web-based (over JavaVNC) secure remote access to his computers:

    Java VNC over SSH [blogspot.com]
  • by linuxkrn (635044) <gwatson.linuxlogin@com> on Thursday January 19, 2006 @07:16PM (#14514146)
    Got one of those on my website.

    Enjoy http://www.linuxlogin.com/linux/admin/sshtunnels.p hp [linuxlogin.com]
  • by Anonymous Coward
    Spider is an employer that wants to block SSH tunnel access for his employees, but he has no idea how to pull it off, so he concocted this excuse about wanting to use our beloved Firefox.

    I think we can all collectively say: Spider, go RFTM. :-)
    (Yes, the man page for ssh covers this in detail.)

    -= End of thread =-
  • Try the HowTo... (Score:4, Informative)

    by Anonymous Cumshot (859434) on Thursday January 19, 2006 @07:20PM (#14514174)
    here: http://www.revsys.com/writings/quicktips/ssh-tunne l.html [revsys.com]

    It's nice and short, but covers the basics.

  • by The Blue Meanie (223473) on Thursday January 19, 2006 @07:20PM (#14514175)
    I *really* hope my employer doesn't recognize my Slashdot ID. :)

    I use an SSH tunnel to forward port 8080 on my desktop machine here at work to port 8080 on my Unix workstation at home that's running an HTTP proxy. I set my Firefox/Mozilla at work to use localhost as its proxy, and I now happily bypass any and all logging and/or site restrictions on my work browsing habits.

    I also remote-forward a pseudo-random high port on that remote workstation at home to port 22 on my work desktop machine, giving me the ability to SSH *back in* to work from home, and not monkey with the company's VPN solution that has a client for my home machine that's so buggy it's unreal. That remote SSH call-back also forwards the home machine's IMAP port to the company's Exchange Server so I can read my email over the tunnel, and I port-forward to our network monitoring and backup systems' web interfaces so I can actually do my job.

    I guess I can say that my productivity from home would be pretty much zippo if I didn't have SSH tunnels at my disposal.
    • by fimbulvetr (598306) on Thursday January 19, 2006 @07:27PM (#14514225)
      This is exactly what I do, and let me tell you what: It's saved my ass a few times.

      I also run two browser profiles with one being the proxied and one being normal, with different shortcuts to each. I separate the instances so my employer still sees a lot of traffic so they don't get suspicious. The work-related ones get me to lots of vendors sites, googling for solutions, etc.

      I use a sh script to start my second one. It looks for an already open port just in case I killed the browser accidently and don't need to re-establish the tunnel. It re-establishes if it needs to.

      You could also proxy your IM messages through these, though I haven't gone to that length yet. Here's my sh script:

      #!/bin/sh

      STAT=`netstat -an | grep 8888`;
      if [ "$STAT" = "" ];
                      then

      #friendshomemachine
      # ssh -L 8888:127.0.0.1:8888 friendshomemachine "perl -e 'while (1) { print localtime."\n";sleep 10;}'" &
      #mine
                      ssh -L 8888:127.0.0.1:8888 myhomemachine "perl -e 'while (1) { print localtime."\n";sleep 10;}'" &
      #friendshomemachine
      # ssh -c blowfish-cbc -C -f -N -L 8888:127.0.0.1:8888 friendshomemachine "perl -e 'while (1) { print localtime."\n";sleep 10;}'" &
      #mward
      # ssh -c blowfish-cbc -C -f -N -L 8888:127.0.0.1:8888 friendshomemachine "perl -e 'while (1) { print localtime."\n";sleep 10;}'" &

      fi /usr/local/firefox/firefox -P encrypted

      I've heard blowfish is slower, but it doesn't seem to be when you're just browsing. Feel free to experiment. Others with more knowledge as to what's faster, please let me know.
    • by Anonymous Coward
      If I ever caught you pulling that kind of shit in the company where I work, your ass would be out the door so quick your feet wouldn't touch the ground.

      There are reasons that the company deploys control mechanisms such as HTTP/SMTP proxies and approved VPN solutions - to protect the corporate infrastructure and information. Yes, you may have SSH access, but that doesn't mean that you should be using that to circumvent the security controls put in place by your employer. Your employer may well be partly to b
      • by Anonymous Coward
        We don't want to work for your kind of company so thats OK
      • I know you shouldn't feed AC trolls, but I'll bite. First, we identify the troll:
        1) pedantic reliance on security policy
        2) Euro spelling of 'unauthorized'
        3) excluded middle fallacy invoked to formally document and submit your request
        4) ITIL-like flamage about change control procedures
        5) assertion that its wrong de jure, instead of right, de facto

        Ok, so now we know it's a troll. What to do?
        1) hopefully metamod the positive mods that he received to correct the error
        2) offer brief counterargument, demolishi
        • You're job is to get work done, and act in the best interests of your employer. If you are doing both, no good manager will complain.


          Which is why the GP is likely not a troll, but an InfoSec person (coming off like an know-it-all/asshole/troll is sometimes an occupational hazard when wearing that hat) as the usability vs security tradeoff swings all the way to the far right and legitimate users are criminalized for legitimately trying to get work done.

          In all fairness, part of the problem is that "good manag
      • I can and do this because I AM the IT staff! So there!!
    • by Dausha (546002) on Thursday January 19, 2006 @08:43PM (#14514737) Homepage
      "I *really* hope my employer doesn't recognize my Slashdot ID."

      Yes, your employer does know your uid. He's pissed, and he's been logging your activity for some time. He suggests a new shell script:

      #!/bin/sh

      while (1) {
      echo "Get to work, Slacker!";
      }
      • your employer...suggests a new shell script:

        #!/bin/sh

        while (1) {
        echo "Get to work, Slacker!";
        }

        that's definitely from his manager, since that while statement is completely C and won't run under bash at all!

      • Obviously, his PHB needs a good sh scripting howto!
      • [codemonkey@pr0nb0x:/home/bigcheeze]{3}$ ./get_to_work_slacker.sh
        ./get_to_work_slacker.sh : line 3: syntax error near unexpected token `{'
        ./get_to_work_slacker.sh: line 3: `while (1) {'
        [codemonkey@pr0nb0x:/home/bigcheeze]{4}$
        Looks like someone forgot how to code once they caught the promotion I was passed over for...
    • I use an SSH tunnel to forward port 8080 on my desktop machine here at work to port 8080 on my Unix workstation at home that's running an HTTP proxy.

      Why not use the built in SOCKS proxy in ssh? Run ssh -N -D 8080 <home-machine> then point your Firefox setup to localhost port 8080 as a SOCKS proxy. Then you can ditch the HTTP proxy on your home machine.

      I also remote-forward a pseudo-random high port on that remote workstation at home to port 22 on my work desktop machine, giving me the ability t

      • Why not use the built in SOCKS proxy in ssh? Run ssh -N -D 8080 <home-machine>

        Because my SSH client doesn't appear to have it:

        $ ssh -N -D 8080 my.home.machine
        Usage: ssh [options] host [command]
        Options:
        ... etc etc etc ...

        It's no biggie, my current setup works fine. But I have to admit that's a pretty cool feature. It's probably specific to OpenSSH. We aren't using OpenSSH here and I don't use it at home.

        That's a really bad idea. You're just asking to get fired.

        Not really. The company

        • For everyone who thinks I'm putting the company at risk:
          1) My machine at home is behind a firewall. A real, separate, dedicated, hardware firewall - not some wanna-be software filter running locally.
          2) I know for a fact there are people running Kazaa on their desktop machines here at work. Yes, the new ISP will address that issue.

          Your company is absolutely at risk. You work there, and are apparently writing policies that concern some aspects of security.

          I really hope someone in management knows your Slas

          • My first thought was that I hope my mutual funds don't own any stock in his company. Then I came to the conclusion that he probably doesn't work for a publicly-traded company. If he did, they would not have passed a sarbox audit.

            I'm trying to figure out who is most at fault. His employer for not taking IT seriously...him for violating good security practices...or the company they hired to "audit" him who passed him without an existing IT policy.
            • Then I came to the conclusion that he probably doesn't work for a publicly-traded company.

              Tell you the truth, I actually don't know. I'd wager you're right, we're probably privately held.

              ... who is most at fault. His employer for not taking IT seriously...him for violating good security practices...or the company they hired to "audit" him who passed him without an existing IT policy.

              All of the above. IT *isn't* taken seriously here, you're right. That will change soon, I can assure you. For lots

              • I agree that your SSH tunnel is just as encrypted as the VPN that the others use. I also agree that the unsecured PCs that the VPN users access your company's network with pose a greater security risk. But what you are missing is that the measure of a system's security is in how it responds to misuse. Your SSH tunnel is insecure because misuse of that tunnel would not be easily spotted by others.

                • First, thank you for a reasoned and sane response.

                  This sounds very similar to the feedback I got from a friend/ex-coworker who is now a paid security consultant. The way he explained it was (paraphrasing): "While you may have taken steps to mitigate the risk of use of the SSH tunnels as an attack vector, and while that mitigation may even be stronger than what's in place for the VPN/home user/travelling laptop attack vector, the fact that those responsible for securing the enterprise are unaware of the SSH
    • I do the same. In my case it's to get around the firewall of a client of mine who changed from a PPTP VPN solution to a proprietary one that I just can't get working on Gentoo from home. They understand that if they want me to work from home (which is 200km away) then I need access to their network.

      I have a reverse ssh tunnel setup from an office computer (also running Gentoo). I use autossh (which I highly recommend) which ensures that the reverse ssh tunnel is always up. Even if my machine is rebooted or
      • Slashdot didn't convert the "<" tags from the command. it should be:

        ssh -L <local port>:<internal address of remote computer to forward to>:<remote port> -p <local reverse tunnel port> localhost cat -
    • by Anonymous Coward
      How would you set up a remote-foward back to your home box so you can ssh back in?
      • Since this was supposed to be a How-To article, all pissing and moaning about security concerns aside, here's my two configs, obfuscated as is obviously necessary:

        Work-side
        ---------
        proxy:
        Host unix.machine.home
        LocalForward 8080:unix.machine.home:8080
        LocalForward 5900:windows.machine.home:5900
        RemoteForward 127.0.0.1:45678:127.0.0.1:22

        The 8080 LocalForward lets me hit the proxy running on unix.machine.home.
        The 5900 LocalForward lets me use VNC on to access windows.machine.home.
        The 45678 Remo
    • I mainly use SSH at work to establish a connection to my mailserver for Thunderbird and occasionally for some quick admin but I've never properly looked at web browsing. One of my colleagues has though and he gave up because he couldn't forward DNS queries, is this right or is there a workaround ?
  • Here's one... (Score:3, Informative)

    by Anonymous Coward on Thursday January 19, 2006 @07:23PM (#14514191)
    1. Set up usual SSH session settings in Putty
    2. Go to Connection -> SSH -> Tunnels
    3. Add new forwarded port. Source Port: 1080, Destination: [blank], DYNAMIC (this is important), Auto. Click on Add.
    4. In Firefox or any other program that supports a SOCKS proxy, enter host 127.0.0.1 (localhost) with port 1080.

    That's it. You'll then be using your SSH connection like a SOCKS proxy.
    • You forgot a step or two:

      5. ???
      6. Profit!
    • To do the same with the command line OpenSSH client:

      ssh -N -f -D 1080

      -D 1080 does the dynamic socks forwarding.
      -N says don't run any command on the remote machine
      -f says go into the background after asking for password

      Works great for Yahoo IM; haven't tested others.
  • Ooh! Where To Begin. (Score:1, Informative)

    by Anonymous Coward
    Here's how I do it.

    ssh -CX user@host.your.domain
    password:
    user@host$ konqueror&


    Or do you want to portforward your browsing?

    After setting up a proxy server like squid on your home machine...

    ssh -L 8080 :localhost:80 host.your.domain

    This Ask Slashdot really should be answered with RTFM or Google!
  • the Internet Security Center at sans.org had an interesting article [sans.org] about getting ready for defcon.. (in order to protect your privacy) While it does not go into very detailed how-to's, it does give a hell of a parnoid BOFH type mindset for defcon. There are some basic guidlines for secure connections using tunneling over SSL in that discussion..
  • Some time ago I wrote a little guide on SSH tunnels with PuTTY [thomasdamgaard.dk].
    This guide also describes how to setup an SSH tunnel in Linux.
  • SSL Explorer (Score:3, Informative)

    by beernutz (16190) on Thursday January 19, 2006 @07:45PM (#14514369) Homepage Journal
    Check out SSL Explorer [sourceforge.net]. It has a windows and linux installer, is easy to use, and is java based, so the client runs pretty much everywhere.
  • Here's mine (Score:4, Informative)

    by Dadoo (899435) on Thursday January 19, 2006 @07:45PM (#14514378) Journal
    We use this actual script (plus a few things I had to edit out for anonymity's sake).

    Assuming a Linux machine at each end, here's the script for the machine that initiates the connection:

            while true; do
                    pppd nodetach lcp-echo-failure 4 lcp-echo-interval 120 \
                            pty 'ssh receiver -T -l user'
                    sleep 10
            done

    Where receiver is the public IP address of your receiving machine and user is the username on that machine. The while loop automatically reconnects if you get disconnected.

    Here's the script for the machine that receives the connection:

            pids=`ps -e -opid,command | grep "pppd local:remote" | \
                    grep -v grep | awk '{print $1}'`

            if [ "$pids" != "" ]; then
                    echo "Found pre-existing connection. Killing pids: $pids" >> ppp.log
                    kill -15 $pids
                    sleep 5
            fi

            pppd local:remote netmask 255.255.255.252 passive \
                    notty nodetach

    Where local is the local end of your PPP link and remote is the remote end of your PPP link. You'll want to call this script from user's .profile. Remember, this is a private link, so you'll probably want local and remote to be internal addresses, i.e. 192.168.x.x.
  • My setup (Score:2, Informative)

    by Evro (18923)
    Setup squid on your linux box, listening e.g. on port 3128. Verify that this is working by setting your browser to use it.

    To get the tunnel working, I forget the exact settings in putty but there's a section for tunnels, tell it to create tunnel from local port 8128 to remote machine's port 3128. Then set your browser to use "localhost:8128" as your proxy.

    The way to setup a tunnel between two Unix boxes (for me) is ssh -L 8128:192.168.0.1:3128 remote-host.
  • by Jherek Carnelian (831679) on Thursday January 19, 2006 @07:53PM (#14514432)
    I'm just guessing, but wouldn't ssh tunnels be readily identifiable if a smart network admin wanted to look for them?

    I'd like to run to a web-proxy at home that I can just point my browser to ala:

    https://mycablemodem.cable.net:4567/ [cable.net]

    that will then access any website and rewrite any internal links to go back through the proxy itself, so for example:

    http://www.yahoo.com/ [yahoo.com] becomes https://mycablemodem.cable.net:4567/http://www.yah oo.com/ [cable.net]

    Anyone got a good, robust re-writing proxy tool like that? Preferrably with at least some sort of minimal security to prevent joe-random from using it without a login/password.
    • Why not just tell SSH to run on port 80 on your home machine? If your sysadmin is looking closely he's still going to wonder what's so good on mycablemodem.cable.net:4569 that you're constantly browsing it anyway.
    • Try apache and mod_proxy perhaps?
    • > I'm just guessing, but wouldn't ssh tunnels be readily identifiable if a smart network admin wanted to look for them?

      No, the port forwarding is done within the encrypted channel. Rather than thinking of ssh as terminal session protocol that uses encryption you really should be seeing it a protocol for creating an encrypted pipe between two arbitrary nodes. This protocol uses the terminal session authentication methods of the destination. The entire contents of an ssh session are hidden using good st

      • > I'm just guessing, but wouldn't ssh tunnels be readily identifiable if a smart network admin wanted to look for them?

        No, the port forwarding is done within the encrypted channel.

        You said what I said.

        I don't want to pin up a session for days or weeks, I want it to look like a normal https session - put it up, do a transfer, tear it down. Leaving it pinned up for long periods with sporadic traffic is bound to draw attention to it.
  • Second time I've posted my guide this week.

    clicky [the-engine.org].

  • We're almost all linux at work, but have a handful of Windows systems, including a server. At home, I'm all Linux. I don't want to run VNC at work, because I don't really need all my desktop stuff at home, I just need to monitor a handful of web pages that monitor the network or access web interfaces that control things. So I tunnel several ports locally at home to those web servers. That way at home I just use a URL like "http://localhost:6809/nagios/" to access the bagios server at work running on wha
  • by cyranoVR (518628) * <cyranoVR@gmail . c om> on Thursday January 19, 2006 @08:18PM (#14514581) Homepage Journal
    http://souptonuts.sourceforge.net/sshtips.htm [sourceforge.net]

    Really good for the beginner - includes information on accessing Samba shares over ssh.
  • by Fred Nerk (128328) * on Thursday January 19, 2006 @08:29PM (#14514654)
    I work in a large telco who's security policy is to restrict everything unless explicitly allowed, and the process to get anything allowed is a 3 month long waste of time.

    I also have an ssh tunnel established from my work PC to my home connection, and I run pppd over that to create a VPN between my home network and the network at work. I realise that this is probably completely against company policy, but the "official" VPN solution only lets me hit the Exchange server, and doesn't let me actually do any work. Most of the company's "work" involves forwarding emails, so it's probably fine for them.

    Unfortunately tcp over tcp is really quite nasty (http://sites.inka.de/sites/bigred/devel/tcp-tcp.h tml [sites.inka.de]) but as nothing else but ssh is allowed out of the firewall at work, I don't have a lot of choice.

    A howto that I found quite helpful is at http://www.tldp.org/HOWTO/ppp-ssh/ [tldp.org]

    Anyway.. on to my anecdote (not required reading):

    Part of my job involves working on a distributed monitoring system which is deployed in a star topography around the country. All the remote sites send & receive data from one central site (with one redundant central site) using a variety of protocols, like ssh, xmlrpc, dns, telnet, snmp, syslog, etc.

    The network was designed by people who were given a set of instructions like "You will use these 2 vendor's systems" and "You must follow these corporate security policies which were written 10 years ago for phone networks", so it's terrible by today's standards (and for an ISP in general).

    There are firewalls between all of my boxes, even though all my boxes are on the management lan, and they only allow a very small set of protocols through - not enough to let my software work. That wasn't the worst part. The worst was that the firewalls are also protecting the billing network so have very low tolerances for intrusion detection and flood protection and such. Basically I can only establish 5 connections per second *across the entire network*. This is clearly not enough for a busy monitoring system. So we decided to build a VPN between all of my boxes using ppp on ssh tunnels.

    I now have a separate ppp interface from the central server to each of the remote datacenter servers, all on the 10.0.0.0/16 network. ip forwarding is enabled on the central site, so now remote datacenters can talk to each other (also blocked by the firewalls) and I can use all the connections I need to. I'm running quagga ( http://www.quagga.net/ [quagga.net] ) on every remote datacenter and the central servers (along with the redundant one) so I can distribute routes to remote datacenter devices and cope with the death of one of the central servers without major service interruption.

    However it really is quite slow. I can only get around 200kb/s over each ppp interface even though the physical links are 100+mbit each. But I really don't need huge bandwidth, just some that isn't firewalled.

    This "solution" has been in production for 6 months now, and I'm sure as soon as the corporate security people find out they will shut it down and I'll go back to not being able to do my job.

  • There are some cute tricks in O'reilly's "Linux Server Hacks" [oreilly.com] which, taken together, can leave you with a pretty sweet setup. #52,#53,#66-#71 are all worth checking out.

    --MarkusQ

  • by zsazsa (141679) on Thursday January 19, 2006 @08:51PM (#14514778) Homepage
    I'm assuming you're on a Windows box. PuTTY's dynamic tunneling mode is the absolute easiest way to tunnel your traffic: it doesn't require setting up a proxy server on the remote system! All you need is an sshd on a server somewhere that allows tunnels. When using dynamic tunneling, PuTTY acts as a local SOCKS proxy. So, just set your browser and other net apps to use a SOCKS proxy on localhost on the port you specify in PuTTY, and you're good to go.

    Here's how to do it, using the latest PuTTY and Firefox versions:
    1. Configure PuTTY. Start PuTTY and put in the address of your host server to connect to on the first screen. In the menu on the left, pick 'Tunnels' from the tree. Under 'Add new forwarded port:' put in 1080 (this is pretty arbitrary, but 1080 is the "official" SOCKS port). Leave 'Destination' blank and choose the 'Dynamic' radio button. Feel free to go back to the 'Session' entry on the menu tree on the left if you wish to save a session so you don't have to do this every time.

    2. Configure Firefox. Under Preferences, click the 'Connection Settings' button from the main 'General' options. Click 'Manual Proxy configuration:' and under 'SOCKS Host' put in localhost with port 1080. Click OK and try to surf. You should now be being routed through your Linux host. You can go to whatismyip.com to verify you're being routed through your host's IP address.

    (I'm pasting this howto from one I wrote on another site [metafilter.com])
  • SSH on port 443 (Score:2, Informative)

    by Anonymous Coward
    Another trick to get through corporate firewalls is to place your SSH server at home on port 443 - the HTTPS port.

    Since both SSH and HTTPS use SSL, it is very hard for a corporate firewall to tell the difference, so often you can punch through in this way if your employer does not allow you to SSH out on the normal port.

    Of course, by doing so you may be violating your company policies and opening yourself up to being fired - so don't blame me if you are.

    Also, if you want to keep the script kiddies from tryi
    • Re:SSH on port 443 (Score:2, Informative)

      by mmogilvi (685746)
      And the easy way to do put ssh on port 443 is to put multiple "Port" lines in your /etc/sshd_config file on your server:
      Port 22
      Port 443
      Then you can still access it on the standard port (22) when it isn't blocked by a firewall.
    • Since both SSH and HTTPS use SSL, it is very hard for a corporate firewall to tell the difference
      SSH (the protocol) doesn't use SSL (the protocol). One common SSH implementation (OpenSSH) uses the crypto libraries of one common SSL implmentation (OpenSSL).

      It would be trivial for a corporate firewall to distinguish between HTTPS connections and SSH connections on port 443 (SSH connections all start with the the identifier "SSH-") but in practice most don't.

  • Install cygwin with the X server. log in to your box at home with ssh -X user@host and use the firefox version you have on the box there. you could pretty much work off any box with that setup.
    • Install cygwin with the X server. log in to your box at home with ssh -X user@host and use the firefox version you have on the box there. you could pretty much work off any box with that setup.

      I basically do that on the occasions when I need to use firefox from my home machine at work or vice versa (except that it is GNU/Linux on both ends for me). The problem is that this is very very slow (DSL line at home). Some programs like emacs, jpilot, xv, and gaim are slow but usuable. Firefox however just hu

  • How about stunnel? (Score:3, Informative)

    by syntax (2932) on Thursday January 19, 2006 @10:21PM (#14515398) Homepage
    You might also look into stunnel [stunnel.org]. It acts more like a traditional daemon with conf file, and also has the neat feature of being able to turn any service into its standard ssl equivilent, if that exists, which is useful for things like imap/pop/http.
  • And if you have occasional problems with ssh sessions being interrupted, use autossh (which requires keys to work properly - and that's a good thing).
  • One question that has always been in the back of my mind, but I have never bothered to actually hook up a packet sniffer and watch, what about DNS queries?

    Most corporations have internal DNS servers, that they could certainly log your suspicious requests (or even hijack and re-route) to various nefarious sites. Does Firefox (Mozilla) route the DNS requests through the tunnel as well somehow? I thought SSH could only do TCP forwarding, so I seem to be missing something. Unless somehow the SOCKS proxy is doin
  • I too have followed the putty-as-socks-proxy route described by others.

    For enabling stuff like iTunes, which doesn't know from SOCKS, try SocksCap [nec.com].

    Finally, I used to have a filter on my work machine's Outlook that would run a program when a message with a particular subject came in from me--the program would ssh-tunnel back to my home machine thus enabling me to log in to work from home, but also establishing the connection only when I wanted it.

    • need to watch out for trying to use VNC over sockscap. Whether it's the Java or the Windows client, both seem to open up connections outside of the tunnel - I think I was able to see them using netstat.

      seems the only safe way to do it (for VNC anyway) might be to setup a static port forwarding and then use the VNC client to localhost:5900, etc.
  • Below a small script that makes a dynamic (SOCKS) tunnel that automagically reconnects when your connection goes down for whatever reason... when you re-invoke the script while the tunnel is already up, then it gets killed and re-created.

    Using this script my tunnel stays up for days in a row and I don't have to do anything when I move my machine from our coporate wired network to my personal wireless home network.

    I use this script in combination with privoxy [privoxy.org] to ensure that dns requests are also done over th
  • For the ultimate SSH tunnel (not limited by TCP ports and the like), it's actually possible to run a full PPP session over an SSH tunnel. As ssh can act as a pseudo-tty to the other end, ppp will happily communicate over it.

    All you need are compatible pppd configs on each endpoint box (by this I mean they're setup that when they talk they authenticate and give IP addresses, etc), and tell pppd to use ssh as the serial link.

    The magic line in your pppd configuration (/etc/ppp/peers/) is:

    pty "/usr/bin/ssh -e n
  • Suppose at the work location, you must route through a local proxy like Squid to get anywhere. (So the browser has to be configured to use the proxy to connect to anything and, amongst other things, putty.exe from the Windoze command line won't work.)

    How do you set up a secure tunnel from workstation through proxy to remote host and then onward to the outside world?

    • afaict the best way is to use the https port (443). its very hard to get away with disallowing it and very hard to do any meaningfull filtering of what flows over it. The vast majority of http proxyies seem to allow http connects to this port.
  • I've posted such a story to Slashdot twice with no success, so I'll take this oppertunity to beg.

    What length ssh keys should I use? 256? 512? 1024? 2048?

    At what point is the line between secure, and paranoid crossed? How will key length impact performance?
    • What length ssh keys should I use? 256? 512? 1024? 2048?

      Use any length you want because I promise you that nobody is going to bother trying to crack even 56bit DES key just to read your data.

      If you are worried that they will, it's just because you are massively overestimating your own significance.

      Honestly, nobody cares. You're just not interesting enough. Sorry to break it to you.
  • I'm using SSH in a fairly mundane way, but one I haven't seen anyone else mention here. I telecommute, and my ISP (DirecWay, unfortunately the only thing besides dial-up available to me where I live) blocks PPTP VPN. So instead to do remote administration, I run RDP over a PuTTY/SSH tunnel.
  • http://www.rs4u.com/SSHTunnel/ [rs4u.com] - great ssh tunnel program for a windows client, alternative to having to setup and manually run putty. Sets up a tunnel, socks5 proxy, lives in your systray, totally clean.
  • Tunnelier is about the best tunneling program out there:
    http://www.bitvise.com/tunnelier.html [bitvise.com]

    Also be sure to check out the SwitchProxy extension for Firefox:
    http://mozmonkey.com/ [mozmonkey.com]

    ...Michael...
  • Since no one else bothered to give you, y'know, an answer, just endless links to tools that might or might not help you...

    Specifically for SSH tunnels (without dealing with SSL), you basically have two choices: Manually authenticated, or pre-shared RSA keys (which you should use even for manually authenticated connections, but I'll leave that to your discretion)...

    In the simplest case (manual authentication with no preshared key, and between any platforms for which a build of the standard OpenSSH tools

"The greatest warriors are the ones who fight for peace." -- Holly Near

Working...