HOW TO - Use Secure Shell (SSH) with the iPad

Discussion in 'Jailbreaking & Hacking Tutorials & How-To Guides' started by f4780y, May 4, 2011.

  1. f4780y

    f4780y
    Expand Collapse
    Super Moderator
    Staff Member

    Joined:
    Sep 11, 2010
    Messages:
    7,114
    Thanks Received:
    648
    What is SSH?
    Secure Shell, more commonly referred to as SSH, is a network protocol which allows data to be exchanged between two devices via a secure channel using shell accounts. SSH should not be confused with SHSH Blobs which are a completely separate subject.
    Wikipedia has a detailed article on SSH if you are interested in the history and detail here - Secure Shell - Wikipedia, the free encyclopedia

    Why would I use SSH?
    On a jailbroken device, SSH is a great tool for transferring files between your desktop computer (or any other client) and your iPad WITHOUT using iTunes. It provides you complete freedom to copy, move, or delete files however you like as well as access the shell and run commands against iOS just as you might do on other linux / unix like systems.

    One of the most common uses of SSH on a jailbroken device is manually copying theme components to and from Winterboard, as well as applying theme component without using Winterboard at all (some folks just don't like it and consider it a resource hog). You can easily move a theme from your iPad onto your desktop computer, change the files somehow, then move them back onto the iPad. Coolness!

    How do I enable SSH?
    In Cydia, you should install the package OpenSSH. If you are using SBSettings you will automatically get a SSH toggle added to the interface to allow you to enable and disable the service whenever you want. That's it, you are good to go!

    Is SSH really secure?
    Yes it is, to establish a SSH connection with a device you need to know one or more shell account username and password combinations for the operating system. By default, your iPad has several shell accounts, but the two most important ones are root and mobile. Like most unix / linux type systems, the root user has acces to everything on the file system. The mobile user is essentially "you" and has access to all your personal files and documents (which root also has access to). By default the passwords for both these users is alpine and so it is important to change this default password for BOTH these users to something of your choosing. Otherwise someone on the same network connection as you could connect via SSH using root / alpine and gain access to all your files and data. I have provided a guide below on how to change the default passwords...

    I've installed OpenSSH on my iPad, now what?
    Once you have SSH enabled you will be able to open a connection from your desktop computer or another device with an SSH client installed. There are literally hundreds of different clients to choose from depending on what you want to do...
    The devices you wish to connect must be on the same wifi network, and it should be as simple as providing the IP address and root / alpine credentials to the client software and answering any prompts which appear. Normally, for the first connection between devices, a "fingerprint" file is saved as a token of trust for future connections. You'll get the idea once you give it a try.

    On Windows.
    PuTTY is an excellent free SSH client to access the command shell on the iPad.
    WinSCP is a free SFTP client which allows you to securely transfer files between the desktop and the iPad filesystem in an explorer like interface.
    Wise-FTP is a paid file transfer client..., and there are many many more.

    I recommend you try PuTTY and WinSCP first as freebies before shelling out (pun intended) on a commercial package. They might just be perfect for your needs!

    On OSX.
    CyberDuck and Terminal are both excellent choices, and I am sure there are a lot more!

    How do I change the default passwords?
    Using your chosen shell client, such as PuTTY or iSSH, connect to the iPad and login with the root / alpine default credentials.
    enter the passwd command in the shell. You will be prompted to provide your new password and confirm it.
    You should also change the password for mobile / alpine. You can do this during the same session as root by using the command passwd mobile and provide the new password details.
    Don't forget, you will now need to use your new password whenever you make a SSH connection to your device. Try it now! alpine should no longer grant you access, but your new password should.

    Don't forget the golden rules!
    Finally, before you go off messing with your iPad files to your hearts content. Remember the golder rules:
    1. Backup iPad - Always have a recent backup of your iPad in iTunes so that if you mess something up by accident, you will be able to restore to a recent backup.
    2. Backup Copy - Before you mess with a file, take a quick copy of it (it's easy thanks to SSH). There are many files on your iPad where if you mess with them and make a mistake, a restore will be your only option unless you can restore a copy...

    Happy SSHing fellow jailbreakers!
     
    #1 f4780y, May 4, 2011
    Last edited: Jan 23, 2012
  2. ntrddragn

    ntrddragn
    Expand Collapse
    iPF Novice

    Joined:
    Mar 9, 2011
    Messages:
    25
    Thanks Received:
    0
    I installed OpenSSH and SBSettings but no where do i see a toggle for OpenSSH. Did i do something wrong?
     
    #2 ntrddragn, May 20, 2011
    Last edited: May 20, 2011
  3. f4780y

    f4780y
    Expand Collapse
    Super Moderator
    Staff Member

    Joined:
    Sep 11, 2010
    Messages:
    7,114
    Thanks Received:
    648
    Make sure you enable it in "toggles" in SBSettings from the "more" menu, and respring / reboot the iPad.
     
  4. ntrddragn

    ntrddragn
    Expand Collapse
    iPF Novice

    Joined:
    Mar 9, 2011
    Messages:
    25
    Thanks Received:
    0
    thanks. :)
     
  5. LoJak

    LoJak
    Expand Collapse
    iPF Novice

    Joined:
    Mar 29, 2011
    Messages:
    46
    Thanks Received:
    0
    Mobile terminal does not work on the ipads. Get issh from the app store and connect to your own device on localhost 127.0.0.1

    Sent from my iPad using iPF
     
  6. dstuttgen

    dstuttgen
    Expand Collapse
    iPad Fan

    Joined:
    Jul 18, 2011
    Messages:
    257
    Thanks Received:
    9
    I have WinSCP set up on my Windoze laptop and can access the iFile on my iPad2 but how then do I access any files on my Windoze laptop from my iPad? I had understood it to mean I could access one machine from another room or across the house. I have OpenSSH installed and enabled in SB settings but I guess I don't understand what is the iPad counterpart to WinSCP.

    DOH!:confused:
     
  7. Mickey330

    Mickey330
    Expand Collapse
    Administrator
    Staff Member

    Joined:
    Aug 30, 2010
    Messages:
    11,864
    Thanks Received:
    2,175
    You are looking for a remote desktop application, such as Splashtop or Jump. They are the ones where you can control your Windows machine with the iPad.

    Here's a good thread to get you started on finding one that'll suit your needs: http://www.ipadforums.net/ipad-apps/1528-best-remote-desktop-app.html

    Good luck.

    Marilyn

    P.S. Now that you have OpenSSH installed, may I suggest you change your default root and mobile passwords on the iPad - as a precautionary measure.
     
  8. dstuttgen

    dstuttgen
    Expand Collapse
    iPad Fan

    Joined:
    Jul 18, 2011
    Messages:
    257
    Thanks Received:
    9
    Thank you for the thread suggestion. I'll check it out. I did change the password.
    Thanks again.
     
  9. dstuttgen

    dstuttgen
    Expand Collapse
    iPad Fan

    Joined:
    Jul 18, 2011
    Messages:
    257
    Thanks Received:
    9
    Thanks again for all your help last night. I got splahtop set up on my iPad and the Winbox.
    Transfered my first files this morning. Put 4 music albums in /var/root and a few pdf's but although I can then place the pdf files in "books", on the shortcut sidebar, and they show up nicely in iBook, when I move my music to the "Media Library" in the sidebar they don't show up when I open "My iPod" to use the player functionality. Not excatly sure what is happening there, I can still play them from the iFile sidebar but would definitely feel better if I could access them from the player.

    Thanks again to all who helped me.;)

    Dan
     
  10. Mickey330

    Mickey330
    Expand Collapse
    Administrator
    Staff Member

    Joined:
    Aug 30, 2010
    Messages:
    11,864
    Thanks Received:
    2,175
    Yeah, well, unfortunately, Apple/iTunes/iPod app code music a little differently (some would say it is annoying odd).

    It's best to not to try to put music onto the iPad for playing spefically through the iPod app. It's best to leave that kind of synching to iTunes.

    That doesn't stop you from SSHing in and putting music on the iPad (I think there are music playing apps you can use, but I don't remember any off the top of my head). Just don't try to put it in the iPod section. Won't work (AFAIK).

    Marilyn
     

Share This Page



Search tags for this page
how to use openssh on ipad
,
ipad putty
,

ipad ssh

,
openssh ipad
,

putty for ipad

,

putty ipad

,
putty on ipad
,
putty ssh for ipad
,

ssh ipad

,
ssh on ipad