Security

Poor man's VPN connection

Tony Mattke · 2010.04.20 · 2 min read

Have you ever needed to access a site that had an IP restriction, or one inside your remote network? Recently I need to access a customers remote monitoring site, but its restricted to a small subnet of IPs. They had no VPN setup for me, so I had to come up with something new…

The answer was creating an ssh connection to their network firewall, which happened to be a custom Linux box I had access to. The setup is actually quite simple, and requires no changes to the remote host. The following command will create a local proxy for your machine to use on port 8080.

bash
hackpro:~# ssh -q2nCTN -D 8080 user@hostname

The only caveat to this setup is that you will need key authentication setup, it will not work with standard password authentication. The following is a list of the options used..

  • -q = Quiet
  • -2 = SSHv2
  • -n = Do not read from stdin (This is why you need to have private key authentication set up!)
  • -C = Compression
  • -T = Disable pseuto-tty allocation
  • -N = Do not execute a remote command or launch a shell. Uses the ssh connection for port forwarding
  • -D = Allocate a socket to listen on the locally. Whenever a connection is made to this port,
    the connection is forwarded over the secure channel. ( Requires root )

The only thing left to configure is your browser. Set it to use localhost:8080 as a SOCKS proxy. Quick, simple, and perfect! As usual, if you have any questions please feel free to leave a comment below.

More in Security
comments powered by Disqus

Related Posts

Automation & Tools

Working with the Embedded Event Manager (EEM)

Cisco IOS has plenty of gems contained within, but few are as fun, and as endlessly useful as the Embedded Event Manager, or EEM.

2010.06.14 · 8 min
Industry & Events

Networking Field Day 40 – Back at it again

I’m Heading to Networking Field Day 40 I’m excited to announce that I’ve been selected as a delegate for Networking Field Day 40, taking place April 8–10, 2026 in Silicon Valley.

2026.02.26 · 4 min
Automation & Tools

Using the Cisco IOS Archive Command

The Cisco IOS archive command is not only very useful in keeping configuration archives, but it can also be used to log commands entered into the router, along with their user …

2010.06.07 · 3 min