Skip to Content

Make smart financial decisions with DailyFinance
AOL Tech

Filed under: Hacks, UNIX / BSD, iPhone

ssh on iPhone

Over at the #iphone channel at irc.osx86.hu, the thoroughly awesome NerveGas has figured out how to enable ssh on the iPhone without using restore mode. The secret lies in overwriting an existing binary and plist to trick the iPhone into calling chmod on the Dropbear ssh server and making it executable.

At this time, NerveGas has used Nightwatch's compiler to create iPhone-compatible versions of curl and ps as well as a number of other useful Unix utilities. (He's working on grep, as I write).

So what does this mean? Well, once you've got ssh installed on your iPhone and active, you can access your iPhone from a shell on your Mac. You can send and retrieve files using scp or sftp. And you can use the compilation toolchain to build other Unix utils or even your own software. It's just a short matter of time until perl and other command-line utilities are iPhone-ready.

Quick Reference

How To. You'll find NerveGas's excellent how-to here.

Necessary files. ssh kit and binaries (with many of the Unix utilities compiled for you).

NightWatch's Binary kit. Download here.

Other utilities. You can download curl, chmod, ps, ifconfig, grep, ed, vim, netcat. You can also find a compilation binkit here.

How do I ssh from my Mac? Look up the IP address under your WiFi settings (click the blue right arrow next to the WiFi network you choose). Then from the Mac's terminal, enter ssh root@IP address and use dottie as your password.

How do I get these to execute. Use /bin/chmod until you can get a shell going. For example, /bin/chmod 555 /bin/ls.

How do I enable scp and sftp? Use NiteWatch's binary kit. Make sure to install all the items in the /usr/tree including the /usr/lib files, otherwise you'll get an error when attempting to run the sftp-server.

How do I get a path to work? Run a shell, like csh, and use the path commands in the shell. I've set up a .cshrc to make things easier.

Where do I get the source for iPhoneInterface with getfile/putfile? The public svn, where you can pull the source, is here. You can grab the latest update to the main.cpp file here.

Thanks to NerveGas and also to pen-x for figuring out how to get Dropbear working and Nightwatch who got the entire compilation toolchain working, to iZsh, bricolage, and to BabyJesus.

Click here to read all TUAW’s iPhone coverage

Reader Comments (Page 1 of 1)

Tip of the Day

To find out what version of Mac OS you are running, go to the Apple logo in the top left corner, click it and choose About This Mac. From that window you will see the version number, processor, memory and chosen startup disk. Clicking Software Update will check for updates, and More Info... will open up an extensive list of everything on your machine.


Follow us on Twitter!
TUAW [Cafepress]

Sponsored Links

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor
Apple Texas Hold 'Em

 

More Apple Analysis

AOL Radio TUAW on Stitcher