I have some problems understanding
sudo. I am logged in on a terminal as an non-admin/non-root user. This "normal" user is not in the sudoers file (and shouldnt be, in my opinion).
Now I try to execute a command that needs admin/root privileges and also access to directories of my normal user – therefore I am not able
su into an admin or root user.
In my understanding
sudo -u root should do the trick – however
it doesn't accept the password for
root (or admin if I try with my normal
admin user). It only accepts the password of the "normal" user which seems
to indicate that the
-u username option doesn't work the way I expect it to
My expectation is that
sudo -u root some_command executes
with the privileges of root and therefore it asks also for the password of root.
TL;DR: How do I execute any command that requires admin privileges AND has access to the files of the "logged in (normal) user" without adding the normal user to the sudoers file?
I have enabled the root user under Mac OS X 10.7.