You are not logged in.

#1 2006-05-22 22:44:50

raven4d
Member
Registered: 2006-05-20
Posts: 11

reboot , poweroff commands !! can't use them !

hi

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 .

anyhelp ?

Offline

#2 2006-05-22 23:11:08

iggy
Member
From: Germany, L.E. - Leipzig
Registered: 2004-10-17
Posts: 367

Re: reboot , poweroff commands !! can't use them !

i think, it is better to do this via 'sudo'.


sorry for my bad english smile

Offline

#3 2006-05-23 01:26:48

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: reboot , poweroff commands !! can't use them !

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".

Offline

#4 2006-05-23 01:32:53

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: reboot , poweroff commands !! can't use them !

Don't forget to edit your /etc/sudoers file by using

visudo

as root


"Oh, they have the internet on computers now."

Offline

#5 2006-05-23 02:18:26

PJ
Member
From: Sweden
Registered: 2005-10-11
Posts: 602

Re: reboot , poweroff commands !! can't use them !

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'

Offline

#6 2006-05-23 13:51:16

Ibex
Member
Registered: 2006-03-02
Posts: 135

Re: reboot , poweroff commands !! can't use them !

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.

Offline

#7 2006-05-23 21:17:16

raven4d
Member
Registered: 2006-05-20
Posts: 11

Re: reboot , poweroff commands !! can't use them !

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 !

Offline

#8 2006-05-24 21:43:42

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: reboot , poweroff commands !! can't use them !

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'.)

Offline

Board footer

Powered by FluxBB