@Colin Has a great answer for the Yulu jailbreak, but I did things a little differently that may be useful to people. His answer focuses on creating a new daemon with a new name so that effectively you have two daemons running SSH. One for the USB and one for other TCP connections. I wanted one listener that listened on all interfaces. I was also on Windows and needed something that worked with that, which Galdolf did not. As a result I went with a Python Script, which I forked to make sure it never disappears on me.
To use this, run:
python usbmuxd\pythonclient\tcprelay.py -t 22:2222
The above maps local port 2222 to the remote port 22. Once this is setup you can use your favorite SSH utility in order to connect in. I used Putty.
- Host: 127.0.0.1
- Port: 2222
Default username of "root" and password of "alpine", but a username of "mobile" and a password of "alpine" can also be used to connect.
NOTE: If you don't know the root password, use Filza to change the permissions of /etc/master.passwd to 666, then via SSH as the mobile user, or utilizing your favorite file editor, edit that file to copy the hash from "mobile" over to "root" to make the passwords the same. (The hash for "alpine" is "/smx7MYTQIi2M", if its needed). You then should be able to login as root then, or use su.
Once your logged in you'll want to find the copies of droplist.plist that are currently on your machine. There are probably more efficient ways to do this, but I used the following command:
find . | grep dropbear.plist
The first entry is the active daemon, but the second one is more important. Its the daemon that Yulu puts in place every time you run the jailbreak (Which you have to do with every reboot). If you only edit /Library/LaunchDaemons/dropbear.plist, it will be replaced every time you reboot.
As a result we're going to edit the one that comes packaged with Yulu, but if you cat the file you'll notice its in a binary PLIST format. To fix this we need Erica Utilities in order to get plutil. You can then run:
plutil -xml dropbear.plist
This will convert the dropbear.plist to XML format. Once this is done you can edit the file in any text editor. I used nano to do the actual editing.
When you're editing the file you want to get rid of the "localhost:" from the last string entry. This will make the listener run on all interfaces instead of only the loopback interface (Which is only available via USB). As a result your file becomes:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Once you've done that you will want to put the file back in binary format:
plutil -binary dropbear.plist
At this point I suggest you reboot the device and validate that the Yalu dropbear.plist file is properly copied over when you re-jailbreak:
After a reboot you should be able to SSH utilizing your phone's IP address and the standard port 22.
- Host: (IP From Settings -> WiFi -> (WIFI NAME)
- Port: 22