Use Your iPhone's Internet Connection On Your Laptop
Posted by Adam Pash at 4:00 AM on November 30, 2007

It's great that your iPhone has a data plan and a killer mobile browser, but when you're sitting at the airport waiting to catch a plane with your laptop right next to you, wouldn't it be nice to use your full-on desktop browser? Out of the box your iPhone won't allow you to tether your EDGE data connection to another computer wirelessly, but with a little ingenuity on your part you'll be browsing the net on your laptop through your iPhone's data service in no time.
NOTE: You're probably asking yourself: "Isn't the EDGE data network that the iPhone uses SLOW?" Well, yes it is. But if you're at all like me, sometimes a slow full-screen browsing session is better than slow browsing on the small screen.
I've only tested this method on my MacBook Pro, but since SSH is platform independent, this should be a workable solution on Windows, Mac, or Linux.
What You'll Need
For this guide, you'll need:
- A computer with Wi-Fi capable of creating an ad-hoc computer-to-computer connection (yours is)
- A jailbroken iPhone (If you don't know how to jailbreak your iPhone, the easiest way is to make sure you're running 1.1.1 firmware and then start here.
- The OpenSSH iPhone application (I'll show you how to get this below)
- An SSH client on the computer you're using. If you're on a Mac or *nix machine, you should be fine. Windows users should check out how to install OpenSHH with Cygwin.
Prepare Your iPhone
Assuming you've already got Installer.app installed on your iPhone (which you will have installed if you've gone through the jailbreak mentioned above), the first thing you need to do is install OpenSSH. So head to your iPhone's home screen and fire up Installer.app. Now go to the Install tab and tap on System -> OpenSSH and tap the Install button. Once it installs, exit Installer.app.
Start Up Your Ad-Hoc Network
This process differs depending on what operating system you're using. As I said above, I've only tested this on a Mac, but I'll point to instructions on how to do the same on Windows as well.
If you are using a Mac, just click the Airport icon in your menu bar and click on Create Network. Then just give your network a name and—if you like—a password.
On a Windows PC you'll need to set up Internet Connection Sharing. You can find instructions for doing so here. Good luck!
Once you create your network, your computer won't be able to connect wirelessly to any Wi-Fi hotspot, just other devices.
Connect Your iPhone to Your Computer
To get your computer and iPhone talking, you'll need to connect your iPhone to the ad-hoc network we created above. To do so, go to the Settings application, tap Wi-Fi, and select your ad-hoc network from the list of available networks.
Once you're connected, tap the blue arrow next to your new network to get info on your connections—namely your IP address. Write that puppy down because you'll need it in a second.
Connect Your Computer to Your iPhone's Internet
Now it's time to make use of the SSH server we installed on our iPhone. From this point on, we're basically following our previous guide to encrypting your web browsing with an SSH SOCKS proxy. Open up your command line application of choice and enter the following:
ssh -ND 9999 root@YourIPAddress
...where YourIPAddress is replaced with whatever you wrote down above.
If this is the first time you're SSHing into your iPhone, it may take a bit for your secure key to be generating, so give it at least 30 seconds. You'll be asked if you're sure you want to continue connecting (answer "yes") and then you'll be prompted for a password. At the time of this writing, the default password for OpenSSH on your iPhone is alpine, though you should change the root password when you get a chance.
After you've entered the correct password, the prompt will appear to hang. That's actually what should be happening, so you're on the right track.
Set Your Browser to Use SOCKS Proxy
At this point you just need to set your browser or operating system to use the SOCKS Proxy we've just set up to route our internet connection through the iPhone's EDGE connection. Gina's post shows how to do this with Firefox, though I'll admit I had some trouble getting the proxy to play properly with Firefox on my Mac. Your mileage may vary, but as an alternative I'll show you how to set it up in Safari, which worked well for me.
First, open the Safari Preferences, go to the Advanced tab, and click the Proxies "Change Settings" button. Make sure you're looking at your Airport advanced settings and are viewing the Proxies tab. Tick the SOCKS Proxy checkbox, enter localhost in the section labelled SOCKS Proxy Server and 9999 in the port next to it. Hit OK and Apply your settings. Then just head back to Safari and you're ready to browse.
Couldn't This Work Better?
I'll admit that my SSH/SOCKS chops are slim, so it's very likely this method could be built on to work even better than what I've set up above. That said, I can now browse from my laptop for free anywhere I've got my iPhone, so it could be worse. There are other methods available for tethering your iPhone, particularly this one, but I like the comparatively easy setup and cross-platform-ness of my setup. Alternatively, if you're feeling particularly adventurous/bored, you can boost your iPhone connection to 3G speeds by tethering the iPhone to a 3G mobile phone (which would be absurdly cumbersome). Tethering your iPhone to your laptop may be against AT&T's terms of service, so keep that in mind if you decide to go forward with this. If you've tried this or a similar method and have your own tips, let's hear them in the comments. Thanks to Lifehacker reader Vinod Panicker for the great idea.
If you're looking for more cool ways to put that iPhone to use, check out my iPhone book.
Adam Pash is a senior editor for Lifehacker who enjoys a good iPhone hack—hell, he wrote the book on it. His special feature Hack Attack appears every Wednesday on Lifehacker AU.

Comments (AU Comments · US Comments)
Robert
Posted September 27, 2008 1:36 AM
Is there a legal less expensive way to tether your iphone to your laptop without violating terms of services (but cheaper than buying an aircard)?
nakmario
Posted 3:46 PM 29/11/07
why would anyone in their right mind want to use an EDGE connection for the internet? The Flash applications, which are everywhere, will make sure that you surf no more than one page before you give up... even on an EVDO connection such connections are too slow for me.
this hack is as much of a non-starter as the iPhone IMHO
nakmario
Ron-Mexico
Posted 3:01 PM 29/11/07
If only other phones offered such cutting edge functionality like this. Oh wait a minute . . .
Ron-Mexico
flufftronix
Posted 2:47 PM 29/11/07
There's a section in those instructions over at the cre.ations.net blog for an OS X system-wide SOCKS proxy would probably work well with this. You'd be able to save it as a configuration in the Networks section of System Preferences, so you wouldn't have to remember what to do each time (or spend the time doing it, either!):
1. Go into your laptop's network preferences
2. Double-click the AirPort connection to bring up the proeprties
3. Click the TCP/IP Tab
4. Select "Manually" from "Configure IPv4"
Enter the IP address: 10.3.3.1, subnet mask 255.255.255.0.
5. Click the 'Proxies' tab.
Scroll down the list of proxy servers until you come to "SOCKS Proxy"
Check the checkbox, and in the "SOCKS Proxy Server" box to the right,
enter the IP address of the iPhone: 10.3.3.2, and a port number
of 1080.
6. Click 'Apply Now' for the changes to take effect
flufftronix
Gizmo
Posted 2:45 PM 29/11/07
Oooooh sooo close to breaking down the one big barrier to me getting an iPhone. I don't want to jailbreak an iPhone so for me, and I suspect many other business people, the iPhone is still an non-starter.
Gizmo
necrolingua
Posted 2:44 PM 29/11/07
Installing Cygwin and OpenSSH on your windows machine just to get an SSH client is the worst suggestion I've ever read on this site (and I've read a lot of bad ones.)
PuTTy is a great SSH client that runs natively on windows. I'm using it right now to browse the web from work using my home network proxy server over an SSH tunnel.
download here: [www.chiark.greenend.org.uk]
To setup PuTTY, Fill in the host name and port on the "Session" screen and specify SSH. Use the settings in the article for the iphone SSH server.
Then go to Connection->SSH->Tunnels to set up the port mapping. In Source port, put 9999, and in destination put youriphoneipaddress:9999, then click "Add".
click the open button and it'll open a terminal screen if it can connect ot your iphone. The instructions in the article after this line: "...where YourIPAddress is replaced with whatever you wrote down above" should work fine.
necrolingua
hypnotik_jello
Posted 2:22 PM 29/11/07
@HeartBurnKid: Different web browsers send different "User Agent" strings - unless you tweaked your laptop's browser to send the same user agent as the iphone, they could tell. Or the fact that your connect was downloading shockwave flash files (which aren't supported on the iphone), etc.
hypnotik_jello
ramman345
Posted 2:21 PM 29/11/07
I do this with my Macbook pro and Blackberry. Usually get about 450k download. Although I'm a big Apple fan I do find it frustrating that the iPhone doesn't do this out of the box. Even the free RAZRs do these without requiring "hacking." Maybe future gen iPhones will have this built in.
ramman345
HeartBurnKid
Posted 1:44 PM 29/11/07
@vsboxerboy: As I understand it, the iPhone has a graphical browser. So, how would AT&T be able to tell the difference between websurfing on your iPhone and websurfing on your lappy? Obviously, you don't want to use this to download the new Ubuntu, but I doubt they'd be able to tell the difference otherwise.
HeartBurnKid
Adam Pash, LH Senior Editor
Posted 1:42 PM 29/11/07
@Keirmeister: Agreed entirely. Most phones can tether internet connections through BlueTooth with relative ease—unfortunately the iPhone isn't one of them, so this SSH method is one of the best alternatives available for the time being.
Adam Pash, LH Senior Editor
Keirmeister
Posted 1:17 PM 29/11/07
I don't want to hate on this method, and appreciate that this tutorial is useful for different computer/phone combinations, but this is a really complicated method for something that is so basic.
At least with the iPhone, the problem is that Apple decided not to implement full Bluetooth capabilities on it (for reasons which I don't know).
The thing is, I create a Bluetooth partnership between my Macbook Pro and my TyTN (Windows Mobile). All I have to do is start my wireless network sharing app on the TyTN (built into the OS), then start the Bluetooth network connection on the MBP. Voila. Piece of cake. Extremely slow. :)
I guess my point is that there is simple support on almost all newer Bluetooth-capable computers for network sharing. All current Windows Mobile phones have this capability. This is old technology now. For Apple to not support this makes no sense - especially since they market the iPhone as an internet device.
All of this SSH stuff and network modifications just seem like overkill. But I guess if you don't have any other choice...fair enough.
Keirmeister
Adam Pash, LH Senior Editor
Posted 12:51 PM 29/11/07
@vsboxerboy: Good point, I'll make a note of this possibility above.
Adam Pash, LH Senior Editor
selfdestruct
Posted 12:44 PM 29/11/07
what kind of speed can you get from the data plan?
selfdestruct
vsboxerboy
Posted 12:40 PM 29/11/07
You should be really careful doing this. Normal iPhone usage will generate a normal amount of data being pulled through the device. If you teather it to your laptop and start pulling down tons of data, it's going to send off a red flag to AT&T and you could face some potentially serious consequences so be warned.
vsboxerboy
hypnotik_jello
Posted 12:22 PM 29/11/07
I'm not sure, but you can probably use Putty on Windows for SSH/SOCKS proxing goodness without resorting to cygwin messiness
hypnotik_jello
pantsonfireliarliar
Posted 4:50 PM 29/11/07
FYI, AT&T's historically been very picky as to tethering agreements. Check out discussions from years past on howardforums.com where people get surprise bills for tethering without having the proper plan. (i.e., they tried to save $30 or whatever per month but end up having to pay a few hundred.)
pantsonfireliarliar
HeartBurnKid
Posted 6:12 PM 29/11/07
@hypnotik_jello: No reason you couldn't do just that, though; I used to have a Firefox extension that let you switch User Agent strings with a simple drop-down box, and the same functionality is built-in to Opera.
HeartBurnKid
Suffer
Posted 7:10 PM 29/11/07
All of these iPhone hack articles just make me love my MOTOROKR E6 that much more! I've been tethering my notebook to it via the included Moto Tools software since I bought it. Opera Mini 4 lets me view "the real web" in the same manner as Safari on the iPhone. Oh, and the Linux based software means I've got forums upon forums of free software to use on it, no jailbreaking required. Finally, I can take it to any GSM carrier I want. Granted it has a smaller touchscreen, but it can do everything the iPhone can (except cost me hundreds in overseas data roaming).
-Suffer
Suffer
rasti
Posted 6:25 PM 29/11/07
You can use your 3G HTC Windows Smartphone as a Wifi hotspot.
@Ron-Mexico:
Your lucky day if you have a n HTC TyTN
(also known as XDA trion / MDA Vario II / VPA Compact III / SPV M3100 / Dopod CHT 9000 / Dopod 838 Pro)
And to pile on To pile on KEIRMEISTER comment:
In Xda Developer you can find a tutorial and a magic piece of software that will do the trick to us, the "poor people" with a Windows Mobile Smartphone
[wiki.xda-developers.com]
Im not sure but i think tis will work too for the HTC Universal and HTC Wizard, have to check deeply in Xda forums.
rasti
doniv
Posted 12:10 AM 30/11/07
I've tried this on Windows using putty and it works quite well.
Yes, EDGE is a slower alternative to 3G - but what about countries where there is no 3G? I'm from India where there's no 3G. This is as good as a roaming internet connection gets.
Yes, this requires Jailbreaking the iPhone and what not, but a lot of people who have gone through the trouble of doing that have ready access to the above method - it's really trivial.
And note that you can set a system-wide proxy on Mac OS as well as Ubuntu Gutsy.
Yes, Apple has crippled the iPhone in quite a few ways and one needs to be a geek to get the most out of it. I guess they need to leave a piece of the pie for RIM and MS as well ;-)
doniv
steveooo
Posted 8:45 PM 29/11/07
You might want to inform people that by doing this you are VOIDING YOUR IPHONE WARRANTY and possibly making it impossible to upgrade your iPhone in the future. So when Apple updates the software and gives us lots of new features and apps they will be stuck with the original iPhone software version.
I wonder if all theses sites and magazines that recommend you break your iPhone and not informing you that you are doing so can be held accountable for there action?
I have never seen this kind of disregard for users or a companies TOS as I have seen around the hacking of the iPhone. These days we have to some of the top mac mags running stories titled 25 tips for power users where 10 of the 25 tips will break your iPhone. That hardly makes you a power user.
The next logical step in this is to have lifehacker running articles how to hack into your bank account to give yourself more money. Nevermind the fact you will goto jail, it works so why not run the story.
Anyone know any good articles on how to hack lifehacker and steal all their data? That sure sounds like fun to me ;-)
its time that large blogs and magazines be held responsible for there recommendations.
steveooo
a1wake
Posted 3:00 PM 29/11/07
If you are using Firefox, you should be able to set it and save it by using the FoxyProxy extension as well. Once its set up, you just select it from a list box that pops up from the status bar.
Check it out here ...[addons.mozilla.org]
I have found it useful on many occasions.
a1wake
joemoma
Posted 2:49 PM 29/11/07
actually, on my cingular 8125 (HTC Wizard) the base OS did not have the internet sharing option...I flashed WM6 to it and did have the option to either use the Bluetooth PAN option, or the usb cable/whatever. I used the bluetooth connection all the way to chicago, and had limited problems, but the connection did drop once in awhile. If you bypass the regular medianet proxy, for 19.99 a month, you can have unlimited tethered laptop data. Surprisingly, the pages did load much quicker than I expected, seemingly much faster than dialup.
joemoma
gstake
Posted 2:10 PM 29/11/07
you say "Open up your command line application of choice and enter the following:". does this mean i will be using the terminal? i am not that familiar with terminal. how do i implement this?
gstake
mibrenner
Posted 1:07 PM 29/11/07
Is it against AT&T/Cingular policy to tether the two?
mibrenner
walkerdarin2003
Posted 12:58 PM 29/11/07
I have done something similar to this. No red flags were sent off to AT&T. For whatever reason though sometimes I would loose connection to my phone because of long usage. Here is a link to the page I followed. [dragonforged.com]
walkerdarin2003
gstake
Posted 12:57 PM 29/11/07
"Once you create your network, your computer won't be able to connect wirelessly to any Wi-Fi hotspot, just other devices." does this mean that i can't use my normal wifi connections later?
gstake
Adam Pash, LH Senior Editor
Posted 11:35 AM 30/11/07
@steveooo: When Apple updates the iPhone firmware and you want to upgrade, you can just restore the software. It's very unlikely anyone will ever be stuck with the original software version.
Second, you own the iPhone. Violating Apple's ToS really only practically means you void your warranty. You're not doing anything illegal. Calling it illegal is like calling it illegal to run Open Office on a Windows PC rather than Microsoft Office. Granted, it's much more of a pain to install third party apps on the iPhone, and it requires jumping through more hoops (for the time being, at least), but it's not illegal. To the best of my knowledge, hacking a bank account is illegal. Jailbreaking your iPhone in this manner will *never* land you in jail.
Adam Pash, LH Senior Editor
scott johnson
Posted 8:07 PM 30/11/07
@Adam: You might want to consult with the Gawker lawyer before issuing such absolute legal advice. Jailbreaking an iPhone could very possibly land you in jail. Not likely, but possible.
scott johnson
Rxram
Posted 9:09 PM 30/11/07
Does anyone have some thoughts on this error I continue to receive?
channel 3: open failed: administratively prohibited: open failed
It has me a bit befuddled.
Rxram
doniv
Posted 3:57 AM 3/12/07
Make sure that you are entering the full name of the website in your browser. Eg - Typing just "google" and pressing enter will cause the above error. Type "google.com" to get the page.
doniv