IPad – Can’t SSH access iPad

ipadrootssh

Once some time ago, I had SSH access to my iPad (3rd generation running iOS 5.1.1) and had changed the root password successfully. Now however, I can no longer access it via SSH. I have gone back and reset the password numerous times (currently back to the stock password of "alpine") but try as I might, all I ever get is "incorrect password" when trying to su from terminal on the device.

Am I missing something about the master.passwd file somehow? I'm using iFile and also iFunBox, and both applications have no problem reading/changing the contents of the file.

Here is the current file content, does anyone see anything wrong with it?

##
# User Database
# 
# This file is the authoritative user database.
##
nobody:*:-2:-2::0:0:Unprivileged User:/var/empty:/usr/bin/false
root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/sh
mobile:/smx7MYTQIi2M:501:501::0:0:Mobile User:/var/mobile:/bin/sh
daemon:*:1:1::0:0:System Services:/var/root:/usr/bin/false
_ftp:*:98:-2::0:0:FTP Daemon:/var/empty:/usr/bin/false
_networkd:*:24:24::0:0:Network Services:/var/empty:/usr/bin/false
_wireless:*:25:25::0:0:Wireless Services:/var/wireless:/usr/bin/false
_securityd:*:64:64::0:0:securityd:/var/empty:/usr/bin/false
_mdnsresponder:*:65:65::0:0:mDNSResponder:/var/empty:/usr/bin/false
_sshd:*:75:75::0:0:sshd Privilege separation:/var/empty:/usr/bin/false
_unknown:*:99:99::0:0:Unknown User:/var/empty:/usr/bin/false

EDIT: Output of ls -l /etc/passwd is:

-rw-r--r-- 1 root wheel 896 Dec 11 13:03 /etc/passwd

Output for master.passwd is:

-rw------- 1 root wheel 780 Dec 11 13:03 /etc/master.passwd

Is there something wrong with these permissions that I'm overlooking?

UPDATE: Sadly I've gotten no further on this. I'm at a complete loss as to what to do, other than wipe my iPad and re-jailbreak in case somehow that will help. Really rather not do that so, I'm still hoping for another solution from someone.

Best Answer

Try creating a new password and pasting it into the master.passwd:

 openssl passwd -crypt -salt /s your_new_password

you will get somthing like:

$ /szArB7q9UBNg

replace the text, so it would look like this:

root:/szArB7q9UBNg:0:0::0:0:System Administrator:/var/root:/bin/sh

After that you may want to try logging in again via SSH with the new password.