0

I am trying to set up the simplest system to be able to proxy from my Firefox via one of our Ubuntu servers.

Initially http/s ports would be enough and it would only happen from 2 concrete IPs (office and home). The server already has a complex IPTables firewall configuration so I really don't want to go via the Squid or Shorewall routes that I've seen published here. I do not need that many features, ACL, cache, etc... just sufficient IPTables rules (or alternative software) so I can set up a proxy on my Firefox and connect via that server. I know an SSH tunnel can be done but no idea how to make Firefox speak with my local SSH and use it as a proxy.

Any help or links would be appreciated.

luison
  • 282
  • 1
  • 7
  • 22

1 Answers1

1

EDIT: For windows, you can try

https://web.archive.org/web/1/http://blogs.techrepublic%2ecom%2ecom/security/?p=421

Below instructions for Linux :)

Set up a dynamic proxy using ssh:

ssh -D 8080 yourserver

Update the proxy settings in firefox. Look under Preferences, Advanced icon, Network tab, then the Settings button under connection. Change your proxy connection to manual, then put 127.0.0.1 as your SOCKS host and the port as whatever you used in the ssh -D command.

You can script it all up by creating a second Firefox profile, let's say it's called "proxy". Then set up a script to handle it all:

#!/bin/bash
ssh -N -D 8080 yourserver &
firefox -no-remote -P proxy
kill %1

I'll leave it up to you to decide if this is all within the bounds of your local security policy.

Cakemox
  • 25,209
  • 6
  • 44
  • 67
  • 1
    +1, but I have 2 notes: (1) Although the particular port number used doesn't really matter, the canonical SOCKS proxy port is 1080, not 8080. (2) Go into Firefox's `about:config` and set `network.proxy.socks_remote_dns` to `true`. This will force DNS queries to resolve from the remote side of the proxy (so that DNS query traffic appears to come from the same place as the browser requests). – Steven Monday Oct 31 '10 at 15:43
  • Thanks. This works (I was not using before the SOCKS proxy option when setting up Firefox). Just clarify that you need to make sure TCP forwarding is enabled on the remote server. – luison Nov 01 '10 at 00:41