PDA

View Full Version : Creating a proxy server in OS X


macintologist
Aug 29, 2006, 02:49 AM
Is it possible to create a proxy server, so that on another Mac somewhere else in the world, I can go to the network system prefs and enter my ip address and connect to the internet through that proxy located on the first Mac?

Tuoder
Aug 29, 2006, 11:12 AM
I really don't see why not, though I wouldn't know how, and I would like to know.

Camelot
Aug 30, 2006, 02:29 AM
Sure. You need to run a proxy server. Squid (http://squid-cache.org/) is one of the most popular open-source proxies you can download and install.

Be aware, though, that you need to give some great care to authentication. Unless you validate yourself on the proxy (via Proxy Authentication) you'll be running an open proxy server that is going to be abused by other users on the internet.

If you know the IP address you'll be coming from, it's easy enough. Alternatively you could open a SSH tunnel to your home system and tunnel the proxy traffic through that, or implement ProxyAuthentication (http://wiki.squid-cache.org/SquidFaq/ProxyAuthentication).

rjt1000
Aug 30, 2006, 09:16 AM
Hi,

You can use SSH to set up a socks proxy on a remote Mac where you have an account.

First setup the remote Mac:

1. Make sure you set up a user account on the remote Mac, and that all user accounts have a strong password
2. turn on "remote access".
3. If the remote Mac is behind a router, you will also need to give it a manual internal IP address and to set up port forwarding on your router to forward port 22 to that manual internal IP address.
4. You will need to leave the remote Mac running (turn off sleep and set it to restart if there is a power failure).
5. You will need to know the external address of the remote Mac, so note it, and if your isp regularly changes it, you will need to purchase a service that regularly informs you of the remote Macs current IP address.

Once set up as above, you start up the proxy from your local Mac using the terminal application and the command:

ssh [email protected] -D 2001

where username is your short username and xx.xx.xx.xx is the remote Macs external ip address. You will need to enter your password.

Now set Firefox on your local Mac to use a socks 4 proxy on 127.0.0.1 (localhost) port 2001, and you can use www.showmyip.com to verify your proxying through the remote Mac.

Now your web traffic will be proxied and encrypted between your local and remote Mac. This should also work with other application that allows you to set a socks 4 proxy.

There is some risk in having remote access setup on a computer which is constantly on the internet. Strong passwords can help deter hackers, but for further security, there are ways to change the port that remote access uses, or to disable passwords and use only encryption keys for access. Others in this forum can give you the details.

Enjoy,

rjt1000

doctorsplotchy
Mar 27, 2007, 09:06 AM
I stumbled on this thread, and the reply immediately preceding mine was extremely helpful and concise.

However, if you happen to be running Little Snitch on the remote mac, make sure you create a new rule for sshd (usually located at /usr/sbin/sshd) to allow it to access the outside world.

I was able to set up the tunnel, the proxy, etc, then for whatever reason firefox would error out. It turns out that Little Snitch was holding up the requests, and then firefox would eventually give up.

Hope this helps
:brick:

mgarciap
Aug 13, 2007, 12:12 PM
Hey Guys,

Is it possible to set up a proxy server from a MAC, and for me to connect to it through a Windows XP PC? I'm trying to access my home internet connection from my work computer (Windows based). Is it possible, have you guys have a shot at this before?

Any information will be greatly appreciate it

Thanks,


Mario


Hi,

You can use SSH to set up a socks proxy on a remote Mac where you have an account.

First setup the remote Mac:

1. Make sure you set up a user account on the remote Mac, and that all user accounts have a strong password
2. turn on "remote access".
3. If the remote Mac is behind a router, you will also need to give it a manual internal IP address and to set up port forwarding on your router to forward port 22 to that manual internal IP address.
4. You will need to leave the remote Mac running (turn off sleep and set it to restart if there is a power failure).
5. You will need to know the external address of the remote Mac, so note it, and if your isp regularly changes it, you will need to purchase a service that regularly informs you of the remote Macs current IP address.

Once set up as above, you start up the proxy from your local Mac using the terminal application and the command:

ssh [email protected] -D 2001

where username is your short username and xx.xx.xx.xx is the remote Macs external ip address. You will need to enter your password.

Now set Firefox on your local Mac to use a socks 4 proxy on 127.0.0.1 (localhost) port 2001, and you can use IP Address properties of your Internet Connection 207.58.150.163 --> showmyip.com <-- (http://www.showmyip.com) to verify your proxying through the remote Mac.

Now your web traffic will be proxied and encrypted between your local and remote Mac. This should also work with other application that allows you to set a socks 4 proxy.

There is some risk in having remote access setup on a computer which is constantly on the internet. Strong passwords can help deter hackers, but for further security, there are ways to change the port that remote access uses, or to disable passwords and use only encryption keys for access. Others in this forum can give you the details.

Enjoy,

rjt1000

rjt1000
Aug 14, 2007, 10:12 AM
Hey Guys,

Is it possible to set up a proxy server from a MAC, and for me to connect to it through a Windows XP PC? I'm trying to access my home internet connection from my work computer (Windows based). Is it possible, have you guys have a shot at this before?

Any information will be greatly appreciate it

Thanks,


Mario

You should be able to set up a socks 4 proxy using SSH, although I have no experience doing this from a windoze based computer. (This is assuming, of course, that your office firewall doesn't block the SSH port 22)

The setup of the remote computer (your home Mac) would be the same as detailed above.

The SSH login from your work computer will require an SSH client for windoze. I believe that PuTTY (http://en.wikipedia.org/wiki/PuTTY) can accomplish this, although I can't give you the specifics.

The SSH syntax should be the same and would be entered into the SSH client on the windoze computer:

ssh [email protected] -D 2001

where username is your short username and xx.xx.xx.xx is the remote Macs external ip address.

Then you would set Firefox on your work PC to use a socks 4 proxy on 127.0.0.1 port 2001.

Slugboy
Aug 18, 2007, 01:08 AM
cygwin has a working SSH client (using OpenSSH) that allows XP computers to use SSH tunnels to attach to the Mac. Make sure that under internet options during install you select the OpenSSH package as well.

Mr.StevenFeldman
Mar 27, 2008, 10:39 AM
My school's filter requires the following proxys to be used to connect to the network
FTP,Secure, WEB, and of course Socks
so is there another way??