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?
how to use command shutdown by users?
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
/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?
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?
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?
ok,I got it,thanks again.