There's a stunningly simple way to create a back door into your Mac using just the tools included with macOS, but all it takes to defeat the threat is FileVault. The Mac will now boot as usual and you’ll have access to the machine with the new password. This is an easier and faster method than the approach taken for resetting lost passwords or using the Mac OS X boot DVD, because it’s changing an existing root users password rather than creating a new admin user account. Both work fine though, so.
Restore Admin Privileges
This procedure should restore admin privileges to an account that has lost those privileges. This procedure is only needed if you don’t have another account that has admin privileges.
Section One
Boot Using Command+R keys:
1. Restart the computer.
2. Immediately after the chime press and hold down the
'COMMAND' and the 'R' keys together.
3. Release the keys when the Utilities Menu appears.
If you use FileVault 2 then open Disk Utility, select the protected volume and click on the Unlock button in the toolbar. You will be asked for your admin password. Quit Disk Utility.
Open Terminal from the Utilities' menu in the main menubar. At the prompt enter the following command:
resetpassword

Press RETURN.
Hack Mac Create New Admin Account On Mac
A window opens to Reset Password. Select your startup volume. From the menu labeled Select the user account select System Administrator (root). Follow the prompts for setting a password. Be sure you write down the new password so you don’t forget it.
No Admin Account Mac
Now, from the menubar select the Restart… option.
Section Two

If you are using FileVault then log in as usual, then select Log Out… From the menubar or press SHIFT-COMMAND-Q. Don’t RESTART. You will be returned to the Login screen.
At the login screen click Other… Enter root in the Name field. Enter the password you set up from Section One in the Password field. This should have you logged in as the “root” user. While in “root” be careful what you type or enter. Carefully follow these instructions.
Open Users & Groups preferences panel. Select your normal administrator account from the list of users and check the box labeled, Allow the user to administer this computer. You will be prompted to restart. After the login window appears, log in as yourself—not as root.
Your administrator status should now be restored.
Section Three

You should disable the root user if you enabled it. Follow the instructions in OS X Mountain Lion- Enable and disable the root user under the heading, “Disable the root user.” You will be asked to authenticate in Directory Utility as root with the password you set in the first section. The linked article also works in Mountain Lion and Yosemite.
How to Create a New User Account if You Cannot Access Your Admin Account
Reboot the computer. At the chime press and hold down the COMMAND-S keys to start into Single-user Mode.
You will boot to a black screen with scrolling white text, release the keys and wait for it to finish.
Enter the following lines at the command prompt pressing RETURN after each:
mount -uw /
rm /var/db/.applesetupdone
reboot
After you reboot the computer you will be taken to the Setup Assistant. When you get to the point where you are asked to set up your new user account, create a new admin account. Be sure to name this user account something different than the admin user account that already exists on the system. When you finish the Setup Assistant, it will automatically log you into the new account.
You can transfer your files from the old account to the new one. See Transferring files from one User Account to another. Once you have moved all your files into your new account, you can delete the old account using Accounts or Users & Groups preferences.
Sep 26, 2017 5:34 PM
