Passwordless Sudo Execution

Sudo allows you to execute (all) commands that would otherwise require root privileges. Once you are a sudoer, entering your password is the only, albeit tiresome, requirement for that. But, strictly speaking, it is not. Because, the /etc/sudoers file may be configured for you to execute specific commands with sudo without entering your password.

The security pitfalls this entails are content of your own contemplation and not covered here. But, in some case like certain scripts, it might make your live much easier when allowing passwordless sudo. The following entry will grant myuser the power to reboot and poweroff my pc without entering a password:

myuser ALL = NOPASSWD: /sbin/poweroff, /sbin/reboot 

In case this doesn't work you may check if those commands are actually symlinks to other commands that have to be added to the list.

Kommentare

Beliebte Posts aus diesem Blog

Ubuntu 16.04.2 Kiosk Mode

This and sed

What To Do When Your Ubuntu System Hangs On Reboot Or Shutdown?