Updated Info: Since I first wrote this post a lot has changed in the world of iPhone hacking. The best place to start now is with either Independence or ZiPhone. I’ve only used Independence and it did do the job. You only need to use one of those two tools to put a package installer on your iPhone and you can then install whatever you want directly on the iPhone itself. You don’t have to mess with any of the stuff I mention below.
Original Post: After a few failed attempts I finally was able to ‘hack’ my iPhone so I can ssh from it onto other servers (from which I can actually do useful things). I ended up using iFuntastic to ‘jailbreak’ the phone. I tried some other methods and none of them worked. That one worked great for me. Once that was opened up I could install sshd on the iPhone (start at step 3 and skip step 5) to allow easy access from my Mac. I then installed MobileTerminal as well as the iPhone openssh binaries to provide me with an ssh command line client. While I was tinkering I also installed the Lights Off iPhone game, which is actually a lot of fun.
This took me longer than it should have and I had to restore my iPhone from a broken state once during the process but now it’s working and it’s pretty nifty. Wahoo!