Do I have to restore my Mac if I've forgotten the admin password?
You can restart the Setup Assistant by performing the following:


Boot into Single User Mode ⌘ + S.
Mount the drive by typing /sbin/mount -uw / then ↩ enter.
Remove the Apple Setup Done file by typing rm /var/db/.AppleSetupDone then ↩ enter.
Reboot by typing reboot then ↩ enter.
Continue setup, making sure not to transfer data.
Setup a new administrator account. You can use this account to reset the password to the original account (through System Preferences → Users &amp; Groups).




The new account can then be deleted once the original account has been recovered.