sudo passwordless commands
What I'm trying to do is to grant my regular user to locally mount partitions and shutdown the machine without a password. Here is what I've done to /etc/sudoers:
Code:
Host_Alias LOCAL = localhost However I am asked for a password whenever I execute "sudo mount [...]" or "sudo shutdown [...]". Am I missing something? |
@ Reply
Hi there,
Try adding this to your sudoers file: <my_username> LOCAL=(root) NOPASSWD: /sbin/shutdown <my_username> LOCAL=(root) NOPASSWD: /sbin/mount |
Does gentoo use PolicyKit. You can add a policy allowing GUI users to have removable media mounted.
Look at "polkit-auth". If it lists policies, is "org.freedesktop.hal.storage.mount-removable" listed? |
Well, there are some entries under /etc/polkit-1/ and /var/lib/polkit-1/ so I suppose it does. However this should only resolve the mount issue, not the shutdown.
And I'm not actually a GUI user. The default login is in terminal from which I invoke blackbox WM (through startx). I don't have either KDE or Gnome or any other WM/DE installed. That's why I'm trying to make these two commands work without password (just to avoid typing it so frequently). And of course to understand further how sudo works. Is it possible that wheel group rule "overwrites" somehow the NOPASSWD rule for the user? |
Looks like it is solved. First of all, instead of "localhost", I put the hostname of the machine.
Secondly, I put the user rule after the group rule Code:
%wheel ALL=(ALL) ALL Thanks for the replies. |
All times are GMT -5. The time now is 05:16 AM. |