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.
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