Using SSH, SFTP, and Terminal

After jailbreaking your iPhone, you’ll want to be able to connect to it.  If OpenSSH hasn’t been installed by Pwnage Tool, you can install it through Cydia on your iPhone.

Once it is installed, it is always running.  This will drain battery power, so you’ll want to install either Toggle SSH and/or SBSettings and/or BossPrefs, all available through Cydia.  SBSettings is the replacement for Boss Prefs, but due to the vital control of settings provided by them, I prefer to install both.

Once installed and running, you can connect to your iPhone with any GUI application that supports SFTP.  This blog focuses on the Mac, so Windows tools are not covered here.  I found that using both ForkLift and Transmit led to problems, and that most people tended to use the freeware CyberDuck.  I followed suit and had fewer problems, so I recommend it.

With CyberDuck, you may be able to connect to your iPhone using bonjour. In a new browser, just click the Bonjour tab. If that works for you, you can basically skip getting your LAN IP as explained below.

You will need to know your iPhone’s LAN IP, which you can view under Settings -> Wi-Fi. OpenSSH uses the default login/password of root/alpine.* If you ever will be using your phone in with public Wi-Fi, you should definitely either change this or disable SSH as explained above, for obvious reasons.

If you know how to configure your router, it is a good idea to set it to assign your device a fixed IP, so it doesn’t change every time.  Usually you can do that by providing your router with the MAC (or Wi-Fi) address of your iPhone. You can find this in Settings -> General -> Wi-Fi Address.

After connecting to your iPhone with SFTP using your client, you should be able to browse your file structure and copy files to it from your Mac, usually by drag & drop.  To move files and folders within your file structure, the best way that I found is to expand the disclosure triangles where appropriate and drag & drop. Note that when copying files from your iPhone to your Mac with CyberDuck using drag & drop, the connection tends to drop in the middle of the copy. I found that the more reliable way is to use the download option from the toolbar’s “gear” menu. Downloads will go to ~/Downloads/.

To set file permissions, which is often necessary, select the file or folder and then Get Info.  You may want to add Get Info to your toolbar by right clicking the toolbar to customize.  If some instruction asks you to apply permissions recursively, it is important to do so.  If you are given a permission code like “777” or “644” and you don’t know what this means exactly, you should be able to check and uncheck the permission boxes until you get it right.

Finally, for more advanced users, it is possible to move and rename files and set permissions directly on your iPhone by installing mobile Terminal, also through Cydia.  For this to be useful, you’ll of course need to know how to use basic UNIX commands like mv, cp, cd, chmod, etc. If not, you’re best of sticking with an SFTP GUI app like CyberDuck.


One Response to “Using SSH, SFTP, and Terminal”

  1. sobrazz Says:

    i have problems opening the programs after it copied into my iphone. It just state applications cannot be opened. Please help.
    many thanks a thousand time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: