If you’ve already jail-broken your iPhone, and have made sure that it has Tethering enabled, either with 3.0 + iTunes or by hacking the CommCenter as described all over the web… There’s a nifty trick you may not be aware of.
You can use iPhone tethering to allow you computer to surf to the iPhone and vice-versa on a local network running over the USB cable…
The iPhone, while in tethering, presents itself as Ethernet over USB modem to the OS connected through USB to it.
The iPhone self assigns a 192.168.20.1 address to itself, and seems to assign 192.168.20.2 (and possibly other 192.168.20.0/24 addresses) to the computer connected to it.
This by itself is more than enough for the iPhone to surf back into 192.168.20.2, or for 192.168.20.2 to ssh into the iPhone over USB (192.168.20.1) etc.
The only “trick” you’d probably still need to employ, is making sure that the computer doesn’t actually access the network over USB + 3G and drain your bank account, just because you felt like SSHing into your device.
For that, all you need to do, is got the network interface properties, whereever they are (Depending on OS etc.) and Make sure the iPhone Ethernet device is configured for static IP address.. (Drum roll.. 192.168.20.2), and the Gateway is just not configured.
This way, the iPhone will still be able to access the PC and vice-versa over USB.
Once you do this, you’ll start appreciating the device much more.
The whole thing feels much more responsive to SSH, command line, python etc. that way.
Here a short video of how this looks on Windows 7, on one of my Boxes: