LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to create a shutdown login in RHEL4 ES (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-a-shutdown-login-in-rhel4-es-747196/)

visitnag 08-13-2009 01:06 AM

how to create a shutdown login in RHEL4 ES
 
Hi

I want to create a shutdown login in RHEL4ES. Please help me.

FragInHell 08-13-2009 01:22 AM

Hi,

You could create a normal linux user then grant them sudo access to the shutdown command.

vishesh 08-13-2009 01:35 AM

loghin to root
write
#visudo
I bottom type
<your login name> ALL=/sbin/shutdown
Now save file

do your user login
type
#sudo shutdown
<type password of your login>

Thnaks

visitnag 08-13-2009 01:57 AM

what i want is i want to shutdown the system thru login....like


login:shutdown
password:********

then system should shutdown immediately....

Wim Sturkenboom 08-13-2009 02:12 AM

From /etc/passwd on my Slackware 10.1 box, there seems to be a standard user on Slackware for this.

Code:

shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
Check your system and you might be able to set a password for this user or you can create a new user and set the home directory to /sbin and the shell to /sbin/shutdown.

Not tested.

vishesh 08-13-2009 02:17 AM

i think you have to write system level script for that. create a user shutdown
in /home/shutdown/.bash_profile
execute
poweroff command
vi /etc/shutdown/.bash_profile
..

poweroff

thnks

mobinskariya 08-13-2009 02:59 AM

Quote:

Originally Posted by vishesh (Post 3641490)
i think you have to write system level script for that. create a user shutdown
in /home/shutdown/.bash_profile
execute
poweroff command
vi /etc/shutdown/.bash_profile
..

poweroff

thnks

for this to work i think one should open the terminal..it wont shutdown when we log into the gui.. correct me if im wrong.
thanx


All times are GMT -5. The time now is 11:48 AM.