Modified master.passwd, now cannot SSH to phone.

Discussion in 'iPod touch Firmware 2.X' started by jo99ix, Apr 28, 2009.

  1. jo99ix

    jo99ix New Member

    Joined:
    Apr 28, 2009
    Messages:
    5
    Likes Received:
    0
    I have iphone 3G, firmware 2.2.

    So this is what I have done so far:

    - Installed openSSH to phone
    - Used WinSCP to access phone on a Windows XP machine
    - I changed the root password in file /etc/master.passwd, using Notepad, and uploaded the file back to iphone
    - I could no longer SSH or use MobileTerminal with my phone


    - Later that day I found a third party application that allowed me to access my root folders without the correct root password
    - I changed /etc/master.passwd to the original state, using Notpad, and uploaded the file back to iphone
    - I still cannot SSH or MobileTerminal to my phone


    Error when SSH is access denied. I tried all variations of alpine, dottie, or my own that I used earlier today. No luck.

    Error message in MobileTerminal is:
    login: /bin/sh\r: No such file or directory


    I can use my phone as usual, download more apps, use iTune just normally. I just cannot SSH or MobileTerminal. What should I do? Will a restore help? Is there anything else I could try before resorting to restore?

    Any help is appreciated!
  2. iZ3RO

    iZ3RO Member

    Joined:
    Jan 1, 2009
    Messages:
    765
    Likes Received:
    0
    Device:
    iPad
    Remember, DFU is your friend.
    DFU restore to stock
  3. jo99ix

    jo99ix New Member

    Joined:
    Apr 28, 2009
    Messages:
    5
    Likes Received:
    0
    I googled and found out that DFU is a recovery mode? Would it return my firmware to original without restoring? Or is this a mode to use when performing a restore?
  4. leadergo

    leadergo Active Member

    Joined:
    Aug 2, 2008
    Messages:
    2,384
    Likes Received:
    6
    well, DFU is a lot more manageable than Recovery Mode, because you can always get out of DFU mode anytime you want. Unlike Recovery Mode, restoring is the only way out.

    I suggest you use DFU mode and restore to 2.2.1, then rejailbreak and all that.
  5. Ezekeel

    Ezekeel New Member

    Joined:
    Mar 15, 2009
    Messages:
    771
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    The master.passwd file should contain lines like this

    Code:
    root:xxxxxxxxxxxxx:0:0::0:0:System Administrator:/var/root:/bin/sh
    The error you get is probably due to the fact that your line looks like

    Code:
    root:xxxxxxxxxxxxx:0:0::0:0:System Administrator:/var/root:/bin/sh\r
    with the addional '\r' at the end. When you login it tries to start the shell as '/bin/sh\r' which fails.

    I guess this is due to the fact that you edited the password file under Windows XP which uses a different format to mark newlines (http://ccrma.stanford.edu/~craig/utility/flip/) which gave you the additional character at the end.

    You could try converting the file to unix format first using the 'flip' program given in the link above or you could try to delete the character by editing the file on your iPod using gTxtEdit.
  6. lolwut37

    lolwut37 New Member

    Joined:
    Apr 25, 2009
    Messages:
    192
    Likes Received:
    0
    Device:
    4G iPod touch
  7. jo99ix

    jo99ix New Member

    Joined:
    Apr 28, 2009
    Messages:
    5
    Likes Received:
    0
    Thank you all for replying and offering tips. I did eventually resolve the problem, here is how:

    I copied an original master.passwd file off of someone else's iphone 3G, firmware 2.2 or newer
    Using a 3rd party software, I was able to get into my iphone directory and place this original file to my phone
    Turn off and on, it worked

    I edited my master.passwd using Notepad in Windows XP. Like Ezekeel guessed, even though I tried to restore the file to its original content, after saving it apparently contained some extra stuff that messed up my root/mobile password. I had to use a fresh copy of someone else's master.passwd to restore my access. This is essentially the same as restoring my phone, when the only file I need restoring is master.passwd.

Share This Page