Page 1 of 1

how to use command shutdown by users?

Posted: 2008/02/13 17:04:05
by kamui0523
The command shutdown works for root only,I cant do it for normal users
[code][kamui0523@localhost ~]$ shutdown -r now
bash: shutdown: command not found
[/code]I try to do 'chmod a+rwx /sbin/shutdown' but no effect,can anybody help to resolve this problem for me?

how to use command shutdown by users?

Posted: 2008/02/13 17:19:07
by Lenard
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]
# User specific environment and startup programs

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

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

shutdown -r now
poweroff
reboot

Re: how to use command shutdown by users?

Posted: 2008/02/13 17:41:37
by kamui0523
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.

Re: how to use command shutdown by users?

Posted: 2008/02/14 02:46:47
by Lenard
I have used the reboot command without any issues, but the reboot alias is also a good idea.

Re: how to use command shutdown by users?

Posted: 2008/02/14 05:39:45
by kamui0523
ok,I got it,thanks again.