i followed the article in arch linux that tells how to make the user able to reboot/shutdown their machines them selfes ..and typed chmod +s halt
now when typing reboot or poweroff
an error will tell permission denied .
i think, it is better to do this via 'sudo'.
sorry for my bad english
I agree, it is better to edit /etc/sudoers (you must be root to edit this file) and add:"your_id ALL=NOPASSWD:/etc/sbin/halt"
Then to shutdown you use "sudo halt".
Don't forget to edit your /etc/sudoers file by using
In my 10th year of Arch
For those who use sudo there is another nice thing to do and it is to add the following into ~/.bashrc . I guess everyone knows how alias works so I am not going to explain more.
alias reboot='sudo /sbin/reboot' alias halt='sudo /sbin/halt'
I guess you need an absolute path to the executables:
chmod +s /sbin/halt && chmod 777 /sbin/halt chmod +s /sbin/reboot && chmod 777 /sbin/reboot
If this don't work, try
chmod +s /sbin/shutdown && chmod 777 /sbin/shutdown
But remember, everybody (even somebody logged in from somewere else) can shutdown or reboot your pc.
hi again ..
yeah i know about sudo ! am not a linux newbie ..
but i donut have any idea about chmod options .. and couldn't use reboot/poweroff anymore even as a root !!
chmod 777 has solved the problem thanx !
chmod 777 makes the file writable by everyone, which is a very very bad idea, especially in conjunction with the suid bit +s. You are practically permitting anyone to run any command as root.
If you must set the suid bit, use some sane permissions like chmod 4755. (The '4' in front is equivalent to '+s'.)