Trilight Zone Forum Index Trilight Zone
Privacy & Anonymity is our specialty !
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Shutdown account to shutdown Linux server

 
Post new topic   Reply to topic    Trilight Zone Forum Index -> Linux
Author Message
thedark
Second Lieutenant


Joined: 30 Jul 2005
Posts: 1074

PostPosted: Sun Jul 31, 2005 10:21 am    Post subject: Shutdown account to shutdown Linux server Reply with quote

1) Setup password for shutdown account:
# passwd shutdown

2) Add access to shutdown –h now via sudo:
# visod
Put any one of following line in your sudo configuration file:
shutdown ALL=/sbin/shutdown –h now
OR
shutdown localhost=/sbin/shutdown –h now

Note that localhost will only allow sudo from local terminal. If you want network based shutdown then make sure you use ALL or IP or Domain name, for complete syntax read man page of sudo.
3) Save and exit to shell prompt

4) Change shutdown shell:
# vi /etc/passwd
Replace existing shell entry (/sbin/shutdown) to
/usr/bin/sudo /sbin/shutdown –h now
Example
From:
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
To
shutdown:x:6:0:shutdown:/sbin:/usr/bin/sudo /sbin/shutdown –h now

5) Save file

6) Test it by login into system with shutdown username and password.

7) Please, note down that sudo will prompt for password. If you wish to get rid of this issue use NOPASS option in sudo configuration file.

Cool Alternatively, you can use sudo only to achieve same effect. This simple hack ensures that ordinary user shutdown system without touching other part of system
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Trilight Zone Forum Index -> Linux All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group