how to use command shutdown by users?

General support questions including new installations

how to use command shutdown by users?

Postby kamui0523 » 2008/02/13 17:04:05

The command shutdown works for root only,I cant do it for normal users
Code: Select all
[kamui0523@localhost ~]$ shutdown -r now
bash: shutdown: command not found
I try to do 'chmod a+rwx /sbin/shutdown' but no effect,can anybody help to resolve this problem for me?
kamui0523
 
Posts: 30
Joined: 2008/02/11 12:24:43

how to use command shutdown by users?

Postby Lenard » 2008/02/13 17:19:07

I have quit using the shutdown command myself because the poweroff / reboot commands are quicker to type. But in any case try using the fullpath/filename;

/sbin/shutdown -r now
/usr/bin/poweroff
/usr/bin/reboot

You might want to adjust your .bash_profile and add the paths if need be, for example;
Code: Select all
# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/sbin:/usr/sbin:/usr/local/sbin:.
# PATH=$PATH:$HOME/bin:.


Then the commads should work without using the fullpath should work;

shutdown -r now
poweroff
reboot
Lenard
 
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: how to use command shutdown by users?

Postby kamui0523 » 2008/02/13 17:41:37

thanks for your quickly reply,I need to make an alias for command shutdown like 'alias restart='shutdown -r now',that I can type restart to reboot computer,and rumor has that command reboot is not safely?Im not sure.so I always type su - to do command shutdown.
kamui0523
 
Posts: 30
Joined: 2008/02/11 12:24:43

Re: how to use command shutdown by users?

Postby Lenard » 2008/02/14 02:46:47

I have used the reboot command without any issues, but the reboot alias is also a good idea.
Lenard
 
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: how to use command shutdown by users?

Postby kamui0523 » 2008/02/14 05:39:45

ok,I got it,thanks again.
kamui0523
 
Posts: 30
Joined: 2008/02/11 12:24:43


Return to CentOS 5 - General Support

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests