how to restore disappeared saved passwords after changing local user login password

The passwords saved for a local user "UL" have disappeared after changing that local user's password and I need to recover them.


Here is my specific setup:


(0) I'm working on a macbook air M2 running ventura 13.3.1 (a) ; I call the machine "mbam2" below

(1) created standard (non-admin) user UL@mbam2 with a local password "foopass"

(2) logged in to mbam2 as UL@mbam2 using "foopass"

(3) as UL@mba2, signed into icloud as UIC@icloud.com but DID NOT enable icloud keychain

(4) browsed to website ABC.com and saved the password on UL's local keychain

(5) logged out LU

(6) logged in to mbam2 as admin to mbam2 and changed LU's local password "foopass" -> "barpass"

(7) logged in to mbam2 as UL using "barpass" and was prompted for UIC password and previous UL password which I supplied

(8) at that time, I didn't realized something was wrong and I logged out of UL

(9) upon logging into UL again using "barpass", I realized the local passwords saved for UL were gone


I've tried


(a) time machine restore - it doesn't seem to restore user accounts to previous state

(b) changing the UL password back to the previous "foopass" password - it didn't restore the passwords

(c) looking in the local keychain directory - I see old keychain files, but they don't seem to contain the missing passwords


Any pointers / suggestions / hints would be greatly appreciated...


Thanks!


Posted on May 6, 2023 6:28 PM

Reply
Question marked as Top-ranking reply

Posted on May 7, 2023 10:19 AM

You could try unlocking the old keychain in Keychain Access, but I think the way it works now is the login keychain gets reset unless you change your password from within your account or with iCloud. It might make a backup of the keychain in the keychains folder, so use Add Keychain to try and find another in the ~/Library/keychains folder.

They have a lot of obscure names, and I don't know how you would identify the old one.

Similar questions

15 replies
Question marked as Top-ranking reply

May 7, 2023 10:19 AM in response to ac1501

You could try unlocking the old keychain in Keychain Access, but I think the way it works now is the login keychain gets reset unless you change your password from within your account or with iCloud. It might make a backup of the keychain in the keychains folder, so use Add Keychain to try and find another in the ~/Library/keychains folder.

They have a lot of obscure names, and I don't know how you would identify the old one.

May 8, 2023 1:23 AM in response to ac1501

after a lot of ultimately not super-useful research, here is what I ultimately did which recovered the passwords I was after:


back up the data in the user account manually

as admin, completely delete the user account and delete all its folders

as admin, recover the full account from time machine

as admin, recreate the account while re-using the folders generated from time machine

login to the account

observe that the passwords are now there

manually re-merge data in the manual backup


Thanks to all who took the time to read my posts and try to help!


May 7, 2023 9:16 PM in response to Barney-15E

This is very hopeful! I just checked the Library box on View Options and also did "chflags nohidden ~/Library" in the Terminal for good measure. I can see the Library folder in my Home folder. But when I Enter Time Machine it's now shown. I'm researching what else I can do to hopefully make it show up if it's really there.


Edit:

defaults write com.apple.finder AppleShowAllFiles TRUE

killall Finder


seems to have done the trick of showing the Library folder which is, in fact, in the Time Machine backup.

May 7, 2023 9:29 PM in response to Barney-15E

I'm able to recover the login.keychain-db and metadata.keychain-db files using time machine as you suggest, but using "Keychain Access" shows that the web form passwords aren't in there.


Comparing with another user account on the same mac, it appears that web form passwords are actually stored in a keychain named "Local Items" which does not appear as a .keychain-db on disk. Reading on the web it seems that this keychain is somehow (perhaps?) backed by a sqlite db stored in keychain-2.db. I can retrieve that file from time machine as well, but now it's a matter of how to read it because it doesn't seem to simple load into "keychain access" as an ordinary keychain...


May 7, 2023 7:48 PM in response to ku4hx

Thanks for taking the time to read and respond. I want to hope that those passwords are still somewhere because I don't know if a recovery process is entirely possible for all of them.


Do you happen to know if there's a chance that they might be backed up somewhere? Perhaps the point you are making in your response is that they are deliberately deleted.

May 7, 2023 7:54 PM in response to ac1501

Thanks for your response! I do see files names login_renamed_1.keychain-db in my ~/Library/Keychains. Viewing that file inside of the "keychain access" app doesn't seem to show the web form filling fields I am missing though...

If you had web passwords in the old keychain, and that one doesn't have any, then it isn't likely the old keychain.

May 7, 2023 8:04 PM in response to Barney-15E

got it thanks. actually I just looked at the dates on that file and it seems like it's an older file predating the password change event.


the one file that does have a date on the day when I changed the password is called "user.kb". I guess that's not a keychain. I see few pages online about what this is. any chance it might hold some hope? there's also an SOSAccountSettings.pb from the following day.

May 7, 2023 9:48 PM in response to Barney-15E

I see a 10+ yr old thread about how to read passwords out of those files but it has some shady looking download links to a "ul.to" redirector...


How do I get passwords out of keychain-2.… - Apple Community


It would be great to know if people believe this is safe and/or if it still might work after all these years.


Certainly it would be ideal if there were some Apple standard way of reading that .db instead...


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to restore disappeared saved passwords after changing local user login password

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.