Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
    
Do you have a problem with SSH (not being able to connect to the iPad at all) or with su/sudo (not being able to change to user once you are logged in)? –  patrix Jan 5 '13 at 10:30
    
I cannot connect via SSH at all, from an external device, due to incorrect password. And if I run terminal on the iPad itself, I can not use su/sudo as it does not recognize the password. –  Jonathan van Clute Jan 6 '13 at 0:00
    
both root and mobile are using the same stock password alpine (/smx7MYTQIi2M). Can you show permission on the master.password? –  neo Jan 6 '13 at 3:19
    
permissions are set to root and wheel. I've tried changing them both to mobile but that didn't help. –  Jonathan van Clute Jan 6 '13 at 3:48
    
Can you do ls -l /etc/passwd and add the result to the question? –  patrix Jan 6 '13 at 9:17

1 Answer 1

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.

share|improve this answer
    
Might be tricky to update master.passwd without root rights –  patrix Jan 12 '13 at 14:52
    
I've already done that since I can edit the file with iFile on the iPad. No change, I am still unable to SSH access the iPad for the same reasons. –  Jonathan van Clute Jan 14 '13 at 22:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.