Results 1 to 7 of 7
ok...
im trying to use terminal to shutdown the computer but when i type in
shutdown -r now
it says 'needed to be root'
any suggestions or comments?...
- 02-22-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 2
terminal
ok...
im trying to use terminal to shutdown the computer but when i type in
shutdown -r now
it says 'needed to be root'
any suggestions or comments?

- 02-22-2008 #2Just Joined!
- Join Date
- Feb 2008
- Posts
- 5
try
su -c "shutdown -r now"
- 02-22-2008 #3Linux Newbie
- Join Date
- Nov 2007
- Location
- Planet Earth
- Posts
- 152
-r option is for reboot... use -h to halt the computer:
Code:sudo shutdown -h now
EOF
- 02-22-2008 #4
Which Linux distro are you using?
Use sudo in Ubuntu or its variants and su - in other distros.It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 02-22-2008 #5Just Joined!
- Join Date
- Feb 2008
- Posts
- 2
ok thanks.. ill try that...
and i know that -r does system restart and -h does halt or shutdown
i am using ubuntu tho...
- 02-22-2008 #6
You should execute this to shutdown machine.
Check this sticky on sudo.Code:sudo shutdown -h now
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 02-22-2008 #7
Unix systems, by default, don't let a normal user shut down the computer. This is because Unix worked as a network, and so if any old Tom Dick or Harry could turn off the computer it could be a disaster.
If you don't like this behaviour, you can disable it quite easily by editing the sudoers file. Alternatively, and this was what I did (as I use Fluxbox and I didn't want to have to go to the log in screen every time I wanted to switch of the computer) you can change permissions on halt or shutdown to allow execution by anyone. This is what I did (in Debian):
This works very well for me.Code:cd /sbin/ chmod 0777 halt
Distribution: Archlinux
Processor: 3 x Amd 64 bit
Ram: 4 GB
Graphics card: Nvidia GeForce 9800 GT


Reply With Quote