Saturday 29 October 2011

HOW TO SHUTDOWN A SYSTEM BY USER


Before going through this documentation first try to login as user and try to shutdown or reboot the system. 

                   As we know that normal user can not shutdown or reboot the system in linux. Because they don’t have privileges to do that.   

                  So try the below procedure to shutdown the system by user.



                        Add a group called shutdown

STEP 1 -: groupadd shutdown (run these command by root)

                        Add the users to shutdown group. whoever users added to the shutdown group will be able to shutdown the computer.

STEP 2 -: usermod –G groupname username

                        Configure sudo to allow members of the shutdown group to actually invoke the assorted  shutdown commands provided in linux.

 STEP 3 -: visudo

                         Add the following lines to the visudo file

STEP 4 -: %shutdown ALL=(root) NOPASSWD:/sbin/reboot
                 %shutdown ALL=(root) NOPASSWD:/sbin/halt
                 %shutdown ALL=(root) NOPASSWD:/sbin/shutdown
                          This allows the “shutdown” group to run /sbin/reboot , /sbin/halt and /sbin/shutdown AS IF THEY WER ROOT.  So run the command with sudo infront.

STEP 5 -: sudo /sbin/reboot

No comments:

Post a Comment