Let users to shutdown via sudoedit ?
Let users to shutdown via sudoedit ?
I just would like that users can shutdown the PC. How to let users have this right ? Code:
# ls -la /sbin/shutdown Quote:
|
Maybe create a new group called 'shutdown' or something, add the users you want to be able to shut down to that group, then add this line to /etc/sudoers:
Code:
%shutdown ALL = /sbin/shutdown Code:
man sudoers |
/etc/sudoers can be edited with visudo
After you run visudo you need to press "i" (w/o quotes) to start typing, and hit Esc to exit insert mode. After you've finished your addition, type :wq. ZZ to close |
Weird ... not working ... :-(
Code:
# whereis shutdown I followed : Quote:
Quote:
then: visudo Code:
Defaults env_reset I rebooted the box ... and not possible to shutdown with xeratul account ... why actually ? thank you |
Change
Code:
%shutdwn ALL = /sbin/shutdown Code:
shutdwn ALL = (ALL) ALL >sudo /sbin/shutdown else >su pwd >/sbin/shutdown |
For a start you created a user called shutdwn, you wanted to create a group called shutdwn, and add your user to that group
Also if you did have a user called shutdwn then they would have complete control for your system! Keep what you did first and when you want to shutdown do (with out qoutes) 'sudo shutdown' :) |
Quote:
it's getting more difficult now ..; soo, how can I make this working for the xeratul user only: Code:
$ shutdown -r now ( If I change to ALL ALL , then the user can do all he wants like roots ? :-( ) |
Always use visudo to edit the sudoers file. As when you use this and save the file it will check that you have used the correct syntax.
To set it up for one user without asking for a password, add this to your sudoers. replace USER with your users name. USER ALL=(ALL) NOPASSWD: /sbin/shutdown Then to shutdonw type 'sudo shutdown' If you want to use sudo to do this then you will have to type sudo. If you want to allow the group users to do this put this in your suduers. $users ALL=(ALL) NOPASSWD: /sbin/shutdown If you want to prompt users for there password to shut the system down remove the NOPASSWD. One thing to point out is thatthe two above examples will let a user shutdown the system from anywhere, ie via ssh, telnet etc. To stop thatyou could use something like, %users localhost=/sbin/shutdown This will let everybody in the group users to only shutdown the system from the localhost. I hope this helps and has not confused things any more for you. :) |
Quote:
I work with : Code:
sudo shutdown -r now containing sudo shutdown -r now thank you |
All times are GMT -5. The time now is 10:09 AM. |