Shutdown Sudo di Centos

Steps to allow non-root non-admin user to shutdown or reboot a CentOS system:
  1. Login as root in the terminal
  2. Create a new group on Centos named ‘developers’ or you may assign the right to an existing group as well.
  3. Install Sudo by using the command: $ yum install sudo
  4. Now edit the sudo configuration using the command: $ visudo
  5. Look for some thing like ‘# %users localhost=/sbin/shutdown now’
  6. Press ‘i’ or insert keyboard button of your keyboard to start editing the config file
  7. Below the above line add the following lines:
    1. %developers ALL=/sbin/shutdown now
    2. %developers ALL=/sbin/reboot
  8. now save the config file by doing:
    1. press ‘Esc’ keyboard button
    2. then type without quotes: “:wq!”
    3. Hit return key
And you are done!

Now any user of the group ‘developers’ will be able to shutdown the system using the following command

$ sudo shutdown now

To reboot:
$ sudo reboot

Control Center,chose Startup Application
Startup program–Add
name Shutdown
command sudo shutdown -h 18:15
Comment “shutdown -h 18:15:

/mf

Post a Comment for "Shutdown Sudo di Centos"