Ubuntu – How to use sudo from a standard user

12.04sudouser-management

If I try using sudo as a non-privileged user, I get a message that the user is not in the sudoers file. I know the Administrator password, but I do not know, how to use it from a non-privileged (Standard) user.

Best Answer

Use pkexec instead. If the current user doesn't have privileges, or if there are multiple users who can authorize an action, it will prompt you to select the user:

$ pkexec true              
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/true' as the super user
Multiple identities can be used for authentication:
 1.  muru
 2.  sysad, (sysad)
Choose identity to authenticate as (1-2): 1
Password:

pkexec, of course, does not follow the sudo configuration, but its own. However, if you added admin users by adding them to the sudo group, they will also be granted Polkit admin rights by Ubuntu's default configuration.