Installer Openssh Sans Cydia Ios

Posted on  by 

SSH is one of the first things you should install and set up on your jailbroken iOS device because it makes securely transferring files to and from your device very easy. Here's how to do it.

Advertisement

Music by Rappy McRapperson

The video above will walk you through the steps of installing OpenSSH, connecting for the first time, and changing your password, but here's an outline of each step for your reference:

Hello, I have jailbreak my iPhone 7 (iOS 10.1) but I do not have Cydia. I would like to install Cydia via SSH but for this I need to install.

  • Hello, I have jailbreak my iPhone 7 (iOS 10.1) but I do not have Cydia. I would like to install Cydia via SSH but for this I need to install.
  • SSH is one of the first things you should install and set up on your jailbroken iOS device. Open Cydia and scroll down the. OpenSSH package page.
  1. Open Cydia and scroll down the main page to where it says 'OpenSSH Access How-To.' Tap that option.
  2. On that page, click the blue linked text 'Open SSH' in the first step. You'll be presented with the OpenSSH package page. Click the install button in the top right corner, confirm when it's finished, and return to Cydia.
  3. Open the Settings app from your home screen and go into your Wi-Fi settings. Click the little blue arrow next to the Wi-Fi network you're currently connected to. Make a note of your IP address in the 'IP Address' field (it should start with 10 or 192).
  4. To connect to your iOS device from your computer, use an SSH-capable application like Terminal on OS X or puTTy on Windows. Type ssh root@YOUR_IP_ADDRESS (replacing YOUR_IP_ADDRESS with your actual IP address). When prompted, enter your password. It's alpine by default. Once finished, you're connected! You can also use an SFTP application like Cyberduck to connect as well, but that'll limit your interactions to pretty much only file transfers.
  5. Lastly, you want to change your password. To do this, type the passwd command. You'll be asked for a new password. Type it (nothing will show up for privacy reasons) and press enter. Type it in again to confirm it. Assuming you type your password correctly, you will be told it was changed successfully.

Advertisement

That's it! Enjoy SSH'ing with your iOS device.

UPDATE: Reader Steve M. wrote in to share the following:

You should also be sure to change the password of the account called mobile. It as the same alpine password. Until the root and mobile account passwords are changed, your phone is at risk.

Advertisement

You can contact Adam Dachis, the author of this post, at adachis@lifehacker.com. You can also follow him on Twitter and Facebook.

Advertisement

Active1 year, 9 months ago

I have sucsessfully jailbroken my iPhone 6s runing on iOS 10.2.

I have installed OpenSSH through Cydia and changed my default password via MobileTerminal.

The only problem is, when I run ssh root@my_iPhone_ip_addr, it just hangs and never connects.

I have tried the SSH toggle springboard application, however it still hangs.

Is there a how I could enable SSH on my phone via a terminal command or some other way?

iProgramiProgram
2,24010 gold badges42 silver badges70 bronze badges

4 Answers

OpenSSH is not compatible with iOS 10.2 and will break things in later releases of the jailbreak. You should uninstall both OpenSSH and OpenSSL (dependency).

grggrg
145k25 gold badges229 silver badges340 bronze badges

You should use the built-in Dropbear. As of Yalu Beta 6, you need to first SSH over USB. Then after changing your password you can enable Dropbear on other interfaces.

Linux or macOS:

  1. Download gandalf binaries (I had zero luck compiling) from the ocaml-usbmux github page. macOS: gandalf_darwin_10_11_x86_64
  2. Connect your device via USB cable, and scan for it.
  3. Put the udid into a mapping file. Make sure device_port 22 (ssh) is mapped!
  4. Run gandalf with your mapping file
  5. SSH to the local_port corresponding to device_port 22 in your mapping file.
  6. Log in with the password alpine.
  7. CHANGE YOUR PASSWORD!!!

Scan

Sample Mapping File

Run Gandalf with Mapping File

Openssh

SSH to port 2000

Change password(s)

Now that you are in your iOS device (your password has been changed, right?) you can enable Dropbear on other interfaces as follows.

  1. Create a LaunchDaemon file to launch a second instance of Dropbear.
  2. Reboot or use launchctl load

Create LaunchDaemon file:

Paste this into the terminal:

Type Ctrl-D to end the input. That now creates the file ssh10022.plist

Reboot or use launchctl

Issues:

Dropbear does not like the iOS default permissions on the mobile home directory, so SSH key authentication does not work. After every reboot I have to log in with password and fix the permissions:

To debug Dropbear: Redirect Dropbear logs to stderr (the example below runs yet another instance on port 10023).

ColinColin

You can not connect to ssh over wifi with the 10.2 jailbreak. You need to ssh over USB. They are several options but the easiest is to use iproxy.

  1. Install iproxy

    brew install libimobiledevice

  2. On the terminal now run the following command.

    iproxy 2222 22

    This will enable you to forward all traffic from port 2222 to port 22 over USB

  3. Now you can connect to the iPhone by running ssh

    ssh root@localhost -p 2222

Notice you connect to localhost not the ip address of your phone. If everything went well, you should be presented with the ssh prompt.

If it doesnt work, check if ssh is running on the iPhone by running

telnet <iphone-ip-address-here> 22

If you cant connect make sure you install the openssh package from Cydia.

JosephJoseph

@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:

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:

Which yielded:

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:

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.

Installer Openssh Sans Cydia Ios 8

e.g.

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:

Once you've done that you will want to put the file back in binary format:

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:

e.g.

After a reboot you should be able to SSH utilizing your phone's IP address and the standard port 22.

e.g.

How To Install Cydia Ssh

  • Host: (IP From Settings -> WiFi -> (WIFI NAME)
  • Port: 22

Cydia Installer Ios 9.3.5

DougDoug

You must log in to answer this question.

Comment Hacker Sniper 3d Sur Iphone Sans Cydia

Not the answer you're looking for? Browse other questions tagged iphoneiosjailbreakssh .

Coments are closed