Imac Login Pw Not Working, Can't Reset In Recovery Mode/terminal


I have an iMac a couple of years old. Can't give any specs because I am locked out of it. I believe it is either el Capitan, not upgraded to Sierra.

I tried to login recently using a valid password. I couldn't get in. After several tries, I got in but a Keychain Access message saying "System was unable to unlock your login keychain" came up. I took a picture of that message, that's how I remember what it said. The message gave 3 options: Continue Log In, Create New Keychain, and Update Keychain Password. I didn't know what to do so I clicked on Continue Log In.

It got me to my main desktop, but another keychain message was still there. I didn't take a pic of that msg so I forget what that one was. It let me do something in Pages and I then turned off computer.

Next day, went to login and it seemed to take my password but only brought me back to login screen WITHOUT the text area to re-enter the password. It just gives me the options below to Sleep, Restart or Shutdown.

Online tips said to go to recovery mode, Terminal and to type in 'reset password'...did that and where it says "Select the volume containing the user account" there is NOTHING listed.

It seems like Keychain Access somehow didn't agree with my password I've been using for years and has locked me out?

I really don't want to lose everything by trying to reinstall the OS. Is there any hope?
Here's an Apple support article about the message that you get. It says "Mountain Lion", but the same message should have the same fix in later OS X versions.

It concerns me about the fact that the Reset Password app does not allow you to see your volume.
Are you using File Vault (secure disk encryption)?
If so, and you turn off your Mac, booting up will bring up an unlock screen, then a login window. Is that what you would normally expect to see?

If you boot to the recovery system again, then choose Disk Utility, try to repair the drive (select your drive from the left-side list, then click First Aid.)
If that is successful (no problems found), then you may want to consider reinstalling OS X. You can do that by quitting the Disk Utility, which takes you back to the main recovery screen.
Choose Reinstall OS X, and let that finish. It may take an hour or longer, depending on the speed of your internet connection (all the OS X files are downloaded, then installed)
This install simply is installing a new copy of system files on top of the current installation. It does NOT erase anything, and your files and your own apps will not be affected. You can think of this as a repair install of OS X. Assuming a good install, and no actual drive problem, you will eventually boot back in to your normal system, and should look exactly as you left it.

BTW - if your iMac is off, turn it upside down. There is an ID label on the bottom of the stand, which will tell you a lot about which iMac you have.
Actually I am not sure if I enabled File Vault but when I turn on the iMac, (before I was locked out of it, obviously) it would show the apple, then it goes to the login screen..I type login password and it goes to desktop. I don't recall seeing any "unlock" screen.

So I did what you said and went to Recovery Mode, and then to Disk Utility. The internal drive on the left side did NOT allow me to select "Macintosh HD". It was greyed out. :(
That probably also means that you can't reinstall the system.
Did you try that?
The reinstall can't even start if you cannot select the destination for the install.
If you CAN select the drive, I would suggest that you let it install.
If you CAN do the OS X install, there's a good chance it will fix your issues.

If there is no drive to select for the OS X install, then you should assume that the drive has failed, and will need to be replaced.

I hope you have a current backup of your drive, as anything that you don't have backed up is likely gone.
If you have a hard drive (not an SSD), then recovery can be more likely on that, but you will probably need to remove the drive from your iMac to make that kind of attempt.
Thanks so much for your responses. You've been most helpful.

I have not tried to reinstall yet. I've been waiting just in case other replies come in.

Someone else on another forum advised to run Terminal in Disk Utility and type in "diskutil list" and provide a screen shot. Based on the pic ( from my phone because I can't get into my computer to give a good quality screenshot) he said it looks like Disk Utility is showing a disk. Is he right? I hope you are able to zoom, sorry..IMG_2504.JPG
No, that image will not zoom (and is hopelessly small, too.) I can make it larger, but the picture is very poor, and can't make out any text at all.
However, that picture appears to show that you have at least 12 or 13 different disks attached.
Is that correct?