Re: How to tunnel http over ssh?

From: Andrew Schulman (andrex_at_deadspam.com)
Date: 01/11/05


Date: Tue, 11 Jan 2005 09:53:38 -0500


> Using putty on windows and sshd on linux

If you want to browse, e.g. www.forbidden.com, you could set up a local
forward from localhost:80 to forbidden:80. Then point your browser to
http://localhost.

That will work for one site, but (1) you'd have to set up a separate
tunnel for each new site, which is infeasible; and (2) even a single
site can include e.g. images from other sites, which would be retrieved
outside of the tunnel.

If you want to just generally browse the web through an encrypted
tunnel, you can set up PuTTY as a local SOCKS server: in the connection
configuration dialog, go to Connection -> SSH -> Tunnels. Under "Add
new forwarded port", enter e.g. port 1080, choose Dynamic, and click
Add. Save your new connection and restart it.

Now tell your browser to use a SOCKS server at localhost, port 1080.
(E.g. in the Firefox options, General -> Connection -> Connection
Settings: SOCKS host localhost, port 1080.) Choose SOCKS v5: this is
very important because it will make DNS queries get resolved remotely,
not locally. So your office's DNS server won't log a request to resolve
e.g. www.pornsite.com.

Now when you browse the web, your browser will "SOCKSify" (enclose in a
consistent wrapper) all queries and send them to localhost:1080, where
PuTTY is listening. PuTTY will send them over the encrypted channel to
the remote host, where the ssh server will unwrap and send them out, and
send any replies back to you over the encrypted channel.

Be sure to turn off the SOCKS proxying in your browser when you don't
need it any more; otherwise all of your traffic will continue to go over
the encrypted channel, and probably be a lot slower.

Happy surfing.

-- 
To reply by email, replace "deadspam.com" by "alumni.utexas.net"


Relevant Pages

  • Remote Desktop and reverse PuTTY tunnels.
    ... I am connecting PuTTY from to. ... This connection sets up a reverse tunnel:2222 -> localhost:22 ... port 21, and the server allocates you a random port for the TX of data. ... This solution will be put on a production server as an alternative to the ...
    (comp.security.ssh)
  • Re: Using Putty for the SSH tunnel AND the telnet program
    ... Putty makes a TCP connection to port 22 on the SSH server. ...
    (comp.security.ssh)
  • Putty and SSH via telnet gateway
    ... I am trying to connect with Putty via a Telnet gateway to my machine at ... which is running sshd on port 443. ... When I telnet directly to the gateway I can establish a connection, ...
    (comp.security.ssh)
  • Re: tightvnc & ssh
    ... > I can ssh to my mandrake box. ... I got a connection error (I forget the exact error ... Which seems to mean that I can't just use tightvnc on the windows ... There is a product called putty. ...
    (comp.os.linux.networking)
  • ssh is not setting DISPLAY
    ... setting the DISPLAY variable on my home machine, so X forwarding ... There's a third Linux box that I can connect to from work via PuTTY, ... tried to replicate everything in this working connection, ... I've read the man page for ssh, but it looks like I'm doing everything ...
    (comp.security.ssh)