Hey folks!
I had to give halt and reboot permissions to a linux user, let’s talk about it:
Login as root and:
$visudo
this will open the file /etc/sudoers, then add the following next lines:
%users YOURHOSTHERE = /sbin/halt, /sbin/reboot
And if you don’t want to have to type a password each time then use this line:
%users YOURHOSTHERE = NOPASSWD: /sbin/halt, /sbin/reboot
Save and close the file.
By now, every user in the users group (/etc/group ) is able to run halt and reboot commands:
#sudo /sbin/halt
#sudo /sbin/reboot
If you don’t want to type the sudo command every time, then add this lines to the ~/.bash_profile of every user:
alias halt=’sudo /sbin/halt’
alias reboot=’sudo /sbin/reboot’
Done!
Source: https://www.linuxquestions.org/questions/slackware-14/halt-or-poweroff-permission-for-users-173360/
No Comments so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>