How to reset the Keychain password in Leopard (OS 10.5) using either Single User mode or Leopard Boot cd?

Tech1ne
Tech1ne used Ask the Experts™
on
I have a PowerBook G4 with Leopard (OS 10.5) on it.  I lost power during system updates.  When the computer was started again, I was unable to login with the Admin password.

I have tried the following:

I used the Leopard Boot cd to reset the password, but when I tried to login, it wouldn't take the password.

I created a new Admin account using Single User mode, but again the password didn't work.

I tried using the root login and password, still the same result, couldn't log into the system.

I have read that, I need to reset the Keychain password.  
All the solutions that I have found require you to be able to log into the system and use the Keychain
Access Utility.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Did you already replace the file:
/Users/Login_Name/Library/Keychains/login.keychain
I would first rename the original, just in case.

Maybe the system got damaged during the update and your time is better spent reinstalling the system, than troubleshooting a corrupted keychain - or some other damaged file.

Author

Commented:
How can I access this file through the Single User mode or Leopard Boot cd?

Commented:
In single user mode (press command + s after hearing the startup chime):

First start the default shell by typing (ignore the quotation marks in the next lines when typing) "bash" ,
then type "ls /Users" to find out the user's short name,
then "cd /Users/short_name/Library/Keychains/" ,
then "mv login.keychain login_keychain_backup",
then type "shutdown -r now" to reboot the Mac.

After that a new "login.keychain" should be created when you log in from the login window. If that doesn't work, I would stop troubleshooting this issue, make a copy of the internal hard drive to an external one, and reinstall the machine.

Another option could be installing the update package (assuming it is a Mac OS X security update) from the command prompt. Although I never tried that after a power failure, just never happened to me.

Good luck.
Commented:
Forget single user mode, it turns the file system into read only :-|
I just ran a test on my own machine.

So you should try it from the CD (I can't test that on my own machine right now).
Start 'Terminal' when booted from the CD/DVD,
then, from the terminal window, type "ls /Volumes/Macintosh\ HD/Users" to find out the user's short name, (assuming the disk name is "Macintosh HD")
then "cd /Volumes/Macintosh\ HD/Users/short_name/Library/Keychains/" ,
then "mv login.keychain login_keychain_backup",

After that quit the terminal and restart, maybe reset the password again.

Author

Commented:
Mac2010,

It didn't work.  I typed the commands for the keychain login, but after I rebooted and tried to login, it still doesn't accept the password.  

What happens if you delete the keychain login file instead of renaming it?  Does it create a new copy of this file?

Commented:
Renaming has the same effect as deleting. Correct filenames and extensions usually are critical for Mac OS X (command prompt). There should be a new login.keychain created when you change/remove the old one and login with the correct password (keychain entries will be lost then).

This is a bit of a complicated problem and I doubt if it can easily be fixed from the command promt. Since something got damaged during the updating process and power loss, it is hard to detemine what exactly got damaged. What appears like a Keychain problem, may be caused by something else that is not working properly.

What strategy to follow next depends a littlebit on what can be done on the PBG4. Is there another user-login with admin priviliges? And does that login work? Or is your current login the only one?

Is is a problem caused by the user account settings? Is the system causing the problem? Trial and error is the only way to find out.

You can try to reinstall Mac OS X from the DVD and choose the "Archive and Install" (I'm not sure if that is the exact name) option. That should install a new system while saving programs and user data. Only the system will be replaced then. But this is not guaranteed as the solution, since the reinstall may import corrupted settings from the old system.

Do you have another Mac available and an external hard drive? Before doing any reinstalling, I suggest you make a bakcup of the PBG4 first.

Commented:
Re-reading this (entire) thread, it appears to me that something with the local directory services got damaged. That should explain why none of the accounts can login.

I still suggest you make a backup of the PBG4 to an external drive, reinstall the PB and copy data from the backup disk if needed. You can try the "Archive and Install" option first. If that doesn't help, erase and install the PB4.

Author

Commented:
Mac2010,

Thank you, for all your help.  I decided the best option is to re-install the OS.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial