how to use command shutdown by users?

General support questions including new installations
Post Reply
kamui0523
Posts: 30
Joined: 2008/02/11 12:24:43

how to use command shutdown by users?

Post by kamui0523 » 2008/02/13 17:04:05

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?

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

how to use command shutdown by users?

Post by 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]
# 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

kamui0523
Posts: 30
Joined: 2008/02/11 12:24:43

Re: how to use command shutdown by users?

Post by 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.

Lenard
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: how to use command shutdown by users?

Post by 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.

kamui0523
Posts: 30
Joined: 2008/02/11 12:24:43

Re: how to use command shutdown by users?

Post by kamui0523 » 2008/02/14 05:39:45

ok,I got it,thanks again.

Post Reply