Make a group be able to run shutdown command without entering a password (CentOS)

0

I used the command visudo -f /etc/sudoers to edit the sudoers file.

How do I make a group be able to run the shutdown command without supplying password?

Matty2

Posted 2015-05-13T16:03:58.343

Reputation: 11

Answers

0

You can often find an example of something like that in the sudoers file like looking at the %wheel group. If a "username" field starts with % it's treated as a group name. So you could do something like

%<group> ALL=NOPASSWD: /sbin/shutdown

To allow any user in <group> on any host using that sudoers to run /sbin/shutdown without a password. Bear in mind, if there are multiple rules that match, it is the last rule that will "win."

Eric Renouf

Posted 2015-05-13T16:03:58.343

Reputation: 1 548

If you found it helpful you may consider upvoting and/or accepting the answer then – Eric Renouf – 2015-05-13T17:29:41.203