I lost the superuser password for my iMac and I don't have the boot disk. I already tried the second answer on this page, but every time I type su from the command prompt, it still asks for a password that I don't have anymore. Is there another way to reset the superuser password?

  • 2
    Did you enable the root user and are referring to that "superuser" password, or did you lose the last (or all) admin user's passwords? As long as you have an admin user, sudo and this article will let you reset (but not recover) the old root password. support.apple.com/kb/HT1528 – bmike Mar 5 '12 at 17:54
sudo passwd root

Enter YOUR password and you're in.

  • You can also disable / re-enable the root user and pick a new password following this article. support.apple.com/kb/HT1528 – bmike Mar 5 '12 at 17:54
  • 1
    You can also use sudo su if you really need su. – Cajunluke Aug 30 '12 at 19:04
  • You might also want to have a look at sudo -i and sudo -s – bot47 Aug 30 '12 at 19:06
  • superb just worked like a charm.. thank you :-) – gahlot.jaggs Dec 18 '17 at 17:38
  • WOW! This really makes me feel I own this Mac. – shrekuu Mar 15 at 9:03

If you have an administrator user account set up on your Mac in addition to the root account, you can use the Directory Utility to do the following:

  1. Open the Directory Utility from /System/Library/CoreServices or in OS X 10.11 and later, System/Library/CoreServices/Applications.

  2. Click the lock button and authenticate as an administrator: enter image description here

  3. Go to the menu Edit > Change root password...: enter image description here

  4. It should prompt you to enter a new root password: enter image description here

Again, you have to have access to an administrator account to do this (so you can authenticate).

Good luck.


The best solution for 10.7 and 10.8 is to boot in recovery mode (CMD+R). Then, open a terminal window and type the command "resetpassword". This will open a window which will allow you to reset any user's password.



I found this on the web.


The obvious downside is the fact you can't actually recover your password: you'd have to delete the account, and use the new administrator. Nonetheless, you could get hold of the files in the Home Folder before the account is deleted, or even after, as OSX allows you to delete an account but keep the files in it.

The files will be protected, though there are some ways in which you should be able to remove the restrictions on them. You could simply use Terminal to chown the directory and all it's contents, and once you remove the permissions all the files in your previous account should be accessible to your new account.

If you decide to follow this method I could provide more information on how to chown the directory, though a web search should do.

Hope it helps!


Open Terminal.app and run:

sudo passwd root

Type the current admin password
Type the new password to root
Re-type new password to root



"Change Root Password" is only available if Root User is enabled.
sudo passwd root command will NOT work unless Root User is enabled. You'll just get an error that password is incorrect, even if you enter your current Admin password.

If you are able to log in to an Admin account to your iMac, access Directory Utility and 'click the lock to make changes'. Mine was located at /System/Library/CoreServices. It can also be accessed via Menu bar: Apple -> System Preferences -> Accounts -> Login Options -> Join - > Open Directory Utility.

Then from Edit menu -> Enable Root User, then enter some password.
Log out of your current account, and log into the root account via username: root

The sudo commands should work from this account.
When done, you may log back into your Admin account and Disable Root User.

The sudo commands can also be run when logged in to an Admin account, after entering su or su root in Terminal.

Normally the command prompt displays $ and sudo commands may not run; it won't even accept the Admin or root passwords. To run these commands, first su to an account that allows them to run eg. root; command prompt in this case normally would display #.

To reset your superuser password, login to any other Admin account, enable root user, then su, then sudo passwd <superuser>

Blank or empty password for root will not allow sudo or su commands; will simply give error: "Sorry"

To enable root user via terminal: dsenableroot
To disable root user: dsenableroot -d

Tested Mac 10.6.8

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .