Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I activated the root-user in Snow Leopard via Directory Utility, gave it a password.

Still whenever I enter sudo whatevercommand into the bash and enter the password it says that its incorrect.

I even tried to enable the root-account via dsenableroot which worked but still can't use the password.

What am I doing wrong?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

sudo temporarily gives your current user root privileges, but doesn't log you in as the root account. Your user account needs to be listed in the /etc/sudoers file. According to this page, the Admin account can use sudo by default. It also details other methods of becoming root.

share|improve this answer

When you sudo, it's asking for your User's password, not root's.

share|improve this answer
    
My user-password is empty. May that be the problem? –  Hedge Jul 17 '11 at 13:40
    
it's probable. Root access generally likes having passwords. –  DTest Jul 17 '11 at 17:53

sudo requires that you enter the password from the account you're switching from (i.e. your regular account), not the account you're switching to (i.e. root). Since you mentioned that your regular account doesn't have a password, this means you cannot use sudo.

So use su instead. su is similar to sudo, but just different enough to be confusing. su requires that you enter the password for the account you're switching to (i.e. root), and to switch to root you must be a member of either the admin or wheel groups. Also, by default su opens a root shell (similar to sudo -s), rather than just executing a single command as root (the default for sudo).

BTW, using a passwordless account isn't a very good idea. OS X doesn't get attacked nearly as much as Windows, but that doesn't mean it's safe to completely ignore reasonable security practices. Especially if you're running SSH (the "Remote Login" service in system prefs), which does get scanned pretty frequently.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.