So I had a very peculiar problem yesterday when I had to setup a Mac for a new user. The only problem was, I could not login to the admin account. That was strange. We provision accounts remotely using JumpCloud, allowing user credentials to be provisioned to individual systems. It allows me greater efficiency to onboard and offboard users.
What happened was the Mac has been inactive for 5 months. For some reason, it couldn't validate my password even though it was the correct one. I tried a few things, like resetting the password for the admin account locally. However, that didn't work. I thought I'd try to use the root account, but for some reason, I couldn't su into the terminal.
So I figured I needed a way to create a new user account, but how do I do that when I could not even access my admin account.
Thankfully, found the answer at Stack Exchange. Was able to create a new local account and then de-associate the other accounts on the Mac and re-provision the system.
So follow these steps to create a new admin account when you don't have access to your admin accounts.
/sbin/mount -uw /then ↩ enter.
rm /var/db/.AppleSetupDonethen ↩ enter.
rebootthen ↩ enter.