the fast, reliable localhost tunneling solution


Using PuTTY to create SSH tunnels with PageKite

2011-10-12, 16:02

PageKite supports tunneling SSH connections. This means that you can use pagekite.py to create a tunnel for ssh just like for web servers.

PuTTY is a nice Windows ssh client. PuTTY supports the proxy connect method that is needed to be able to use ssh over pagekite.

It is assumed in this HowTo that you have exposed an SSH server running on the same machine as pagekite.py with a backend command like:

$ pagekite.py 22 ssh:home.YOU.pagekite.me

Or a line like this in your configuration file:

backend=raw/22:home.YOU.pagekite.me:localhost:22:S3Cr37

Set up a PuTTY session

Lets assume you are running an ssh server on the backend you've made accessible from the name home.YOU.pagekite.me. Create a session for it in the PuTTY session dialog and save it under a name, here Home.

PuTTYSessionSetup

Before you can connect to the SSH backend you have to specify that you want to have PuTTY connect through a proxy.

On the right in the PuTTY session dialog you can select Proxy. There you specify that you want to use the HTTP proxy method. The proxy hostname should be set to the pagekite name, here home.YOU.pagekite.me, port 443.

PuTTYProxySetup

Go back to the Session dialog and save this under Home (or the session name you chose).

Try using this session to connect to your SSH kite and verify it is working.

Using PuTTY/SSH to create TCP tunnels

SSH can be used to tunnel any TCP based port/protocol through the SSH connection. This means that once you have set up a SSH/PageKite connection as described above you can tunnel any TCP connection through it.

The VNC remote desktop protocol is often used through SSH tunnels. This is a great way to access your desktop at home from anywhere!

The default port for VNC is 5900. To access a VNC shared desktop on your backend SSH server from the machine you are running PuTTY on you simply need to forward port 5900 on the backend to port 5900 on the PuTTY machine. This is easy to do in the SSH/Tunnel dialog in PuTTY.

Set source port to 5900 and destination to localhost:5900. This means forward port 5900 on the PuTTY machine (source port) to port 5900 on the machine running the backend (localhost seen from the backend).

PuTTYTunnelSetup

A good VNC client for windows to use with this setup is TightVNC. Simply use the VNC client to connect to localhost. The connection to port 5900 on the PuTTY machine will be forwarded to port 5900 on the SSH server backend.

To get the best performance you should experiment with VNC encodings. The author of this HowTo has had good success with the Hextile encoding and 8bit color.

Troubleshooting

SSH disconnects if idle

Some firewalls seem to disconnect sessions when there is no activity. You can instruct PuTTY to send empty data packets at an interval to make it look like the connection is active. Go into the Connection entry in the the PuTTY setup and set "Second between keepalives" to something larger than zero.

ConnectionKeepalive

[ Wiki home ]

Comments

  1. Dmitry said on 2012-08-07, 06:15
    Thank you, this is very helpful!
    Permalink
  2. Trip4004 said on 2013-03-04, 19:50
    Any chance of a HowTo for RDP the remote desktop protocol? I can't get it to work.
    Permalink
  3. Trip4004 said on 2013-03-04, 20:03
    Nvm
    Permalink
  4. Mariusz said on 2013-03-25, 13:14
    Hi

    Normally I have no problem to connect via ssh and pagekite to my server but it is not possiblke for me if I try to do it from Intranet (for example there is Internet Explorer configured to use proxy on dedicated port and if I try to open page I have to use my Windows username and password. I try to connect to my server sia Putty and pagekite but in this environment it is not possible. I think I should Putty's Connection -> Proxy tab fill using my intranet proxy and port, byt according to manual above I have to put there home.YOU.pagekite.me, port 443. So it is not possible to use this LAN proxy settings. Is it possible to connect in any way to my server from this LAN where I have tu use proxy even to web browsing?
    Permalink
  5. Bjarni RĂșnar Einarsson said on 2013-04-22, 19:34
    Mariusz, I am afraid not. That would require Putty to support chained proxies, which as far as I know it does not do. This is one of the unfortunate limitations of the proxy connection method. Sorry!
    Permalink
  6. wilc said on 2014-11-08, 23:09
    Hey, i set up a putty connection exactly like this howto, but when i try to connect it says that the connection was unexpectedly aborted, and in the pagekite.py window at the same moment i see my ssh server going down. i had to restart it to get it up again... i even tried putting my antivirus and firewall completely off.. any ideas?
    Permalink

Leave a comment

( (Please leave these blank: )

We use Gravatar for commenter's photos. Get your own, it's free!