Today I have tried my client PC run shutdown and reboot command without being enter sudo password. The details given below
Use the command "sudo visudo" to edit the file. Now look for the line "# User alias specification" and add a list of users as follows:#
User alias specification
User_Alias USERS = user1, user2, user3
# Cmnd alias specification
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt
Code:
:%admin ALL=(ALL) ALL
USERS ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS
EDIT: By the way, the reason that these commands can't be used by normal users is that Linux was designed as a multi-user system. You don't want one user shutting down the system while others are using it!
No comments:
Post a Comment