I have a Linux server running ubuntu 10.04 server. I would like to tunnel my iPhone traffic through this server using ssh, but that's not such an easy solution. Is there a way to simulate a VPN over ssh so that I can configure my iPhone to connect to this VPN and protect my traffic?

I know I could set up a real VPN server but it looks kind of complicated and "expensive" (resources I mean).

Any ideas? Thanks!

  • Need more info. What kind of phone? Do you know what TCP/UDP ports? Can you provide a usage example? – JeffG Mar 4 '11 at 22:12
  • Also, if SSH port-forwarding is too minimal, don't give-up on VPN. OpenVPN is very easy, and free. It also integrates with the NetworkManager applet in Ubuntu. – JeffG Mar 4 '11 at 22:16
  • @JeffG - easy to use on his iPhone? I think not. – EEAA Mar 4 '11 at 22:22
  • @ErikA If the iPhone is jailbroken/rooted then not so hard. – JeffG Mar 4 '11 at 22:29
  • @Ian see this thread: linuxquestions.org/questions/linux-networking-3/… I know it envolves a VPN setup :/ but it's probably just complicated, and not expensive. – JeffG Mar 4 '11 at 22:35

Many SSH client implementation support the ability to act as a SOCKS proxy server for an open SSH connection. On a typical client, you'd set a 'dynamic' port forward on, say, port 1234, and you've instantly got a SOCKS proxy running on localhost:1234. Configure your system with this address as a SOCKS proxy and all net traffic will travel down the SSH tunnel first, giving you a cheap and easy VPN-like solution.

Getting it to work on an iPhone will depend entirely on finding an SSH client that supports this, and the ability for the iPhone to use a SOCKS proxy.

As mentioned in the comments, OpenVPN would be your next best option.

edit the syntax for setting this up on a conventional ssh client would be ssh hostname -D1234

  • But how would OpenVPN ease the configuration on the iPhone? Would OpenVPN work if my server is directly connected to the internet and not part of a network? – Ian Mar 4 '11 at 23:29
  • You should be able to configure an OpenVPN server on your Ubuntu box to provide internet connectivity (some form of IP forward or NAT) to VPN clients. It would simply issue an RFC1918 address from an internal pool and then NAT internet requests down the VPN network interface to the clients. I don't own an iPhone, so I'm speculating that if there's an OpenVPN client for the iPhone, this should be relatively simple to do, I'd use google to get some simple configs/tutorials on OpenVPN setups. – growse Mar 4 '11 at 23:33
  • guizmovpn.com <- OpenVPN Client for iPhone (requires jailbreak) – JeffG Mar 4 '11 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.