Run my Mac command “chsh -s /usr/local/bin/false” and can't log in to my account again
I really messed up! Since I ran my Mac with the command below
chsh -s /usr/local/bin/false
Several minutes later, I noticed my Mac logged out by itself. So, I tried to log back in by clicking 'change user' But I can't see my administer account there.
I guess 'false' is not a loggin-able shell, that's why my account is hidden.
I'm trying to change my shell with Terminal.app on recovery mode or single-user-mode (but both are read-only).
So right now, I want to know if there's any solutions that might be able to fix this problem.
OK - bummer situation, but probably pretty easy to get around.
- Boot in single user mode, mount the drive as read&write by running
/sbin/mount -uw /
, remove the/var/db/.AppleSetupDone
file and make a new admin account - Use that admin account to change back the shell for your user.
- Log out and check your account.
- Clean up the “temporary” admin account if you wish.
Nothing can go wrong, except for perhaps FileVault or no backup or a firmware password so if you can finish a backup or might have another admin account already - using that would be much better in case the above outline isn’t workable for you.
iMac is stuck in a login loop
https://support.apple.com/en-us/HT202860