bash won't accept my root password after activating it in Snow Leopard

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?

Hedge

Posted 2011-07-17T13:21:50.533

Reputation: 1 044

Answers

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.

Chris Acheson

Posted 2011-07-17T13:21:50.533

Reputation: 1 089

3

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

DTest

Posted 2011-07-17T13:21:50.533

Reputation: 245

My user-password is empty. May that be the problem? – Hedge – 2011-07-17T13:40:23.950

it's probable. Root access generally likes having passwords. – DTest – 2011-07-17T17:53:22.447

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.

Gordon Davisson

Posted 2011-07-17T13:21:50.533

Reputation: 28 538