1

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?

0

3 Answers 3

2

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.

3

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

2
  • My user-password is empty. May that be the problem?
    – Hedge
    Jul 17, 2011 at 13:40
  • it's probable. Root access generally likes having passwords. Jul 17, 2011 at 17:53
3

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.

You must log in to answer this question.

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