Wednesday, November 10, 2010

Grant user shutdown permission in suoders file

Yes, you will have to edit your sudoers file in /etc

You will have to edit it so it looks like this:
# %users localhost=/sbin/shutdown -h now
paul ALL=(ALL) ALL
paul ALL=NOPASSWD: /usr/bin/thunar
paul ALL=NOPASSWD: /sbin/reboot
paul ALL=NOPASSWD: /sbin/shutdown
paul ALL=NOPASSWD: /usr/bin/pacman -Sy


In Arch you can define your default editor in /home/user/.bashrc

export EDITOR=nano


Of course replacing paul with your username.
What you do is that as superuser you grant user paul the permission to do certain superuser things like shutting done without password.
You will have to edit the sudoers file not with an ordinary texteditor but with "sudo visudo" in the terminal.

"visudo" is the command used to edit the /etc/sudoers configuration file. It is not recommended that you use any other editor to modify your sudo parameters. "visudo" uses the same commands as the "vi" text editor.

Always make a backup of your old original sudoers file;nevertheless visudo is often configured to work with nano.
To be sure it uses nano you can change the editor visudo uses, by typing

#EDITOR=nano visudo

to edit the file

Ctrl+o, Enter to save
Ctrl+x to exit.

No comments:

Blog Archive

About Me

Exclusion of liability Regarding StillStupid: The use you make of the guides, tips and downloads that you listed on this web site or on another website to which I refer is entirely at your own risk. In no way can I be held liable for damage or consequential damages of any kind, which occurs as a result of that use.