You are not logged in.

#1 2004-02-22 19:52:19

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 706
Website

Halt and Reboot from normal user [wiki]

How can I get a normal user, (or maybe a user from group shutdown) to be able to shutdown the computer?  I have to login as root everytime!


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#2 2004-02-22 20:13:45

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Halt and Reboot from normal user [wiki]

You can setuid the halt or shutdown binaries (chmod +s /sbin/halt). What I did though was editing inittab and replaced "shutdown -r" with "shutdown -h", so the pc poweroffs when I do ctrl+alt+del, instead of rebooting.

Offline

#3 2004-02-22 22:56:56

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Halt and Reboot from normal user [wiki]

Or install sudo and use that.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#4 2004-02-23 01:42:29

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 706
Website

Re: Halt and Reboot from normal user [wiki]

Can I get it to save the password, just for some programs? So, if someone in my family needs to reboot, they can do it without knowing my password?


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#5 2004-02-23 01:49:41

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,363
Website

Re: Halt and Reboot from normal user [wiki]

punkrockguy318 wrote:

Can I get it to save the password, just for some programs? So, if someone in my family needs to reboot, they can do it without knowing my password?

make a new usergroup and make the users you want the members of this group, then chmod/chown the programms you want to run by this group


The impossible missions are the only ones which succeed.

Offline

#6 2004-02-23 02:58:25

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 706
Website

Re: Halt and Reboot from normal user [wiki]

dp wrote:
punkrockguy318 wrote:

Can I get it to save the password, just for some programs? So, if someone in my family needs to reboot, they can do it without knowing my password?

make a new usergroup and make the users you want the members of this group, then chmod/chown the programms you want to run by this group

I do that, but it says...
halt: you must be superuser


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#7 2004-02-23 10:07:38

andy
Member
From: Germany
Registered: 2002-10-11
Posts: 374

Re: Halt and Reboot from normal user [wiki]

Someting different alltogether : if you want a user at the console to shut down the computer and if your windowmanager/desktop-environement does not catch Ctrl-Alt-Del you can edit /etc/inittab so that the ctraltdel line reads :

ca::ctrlaltdel:/sbin/shutdown -t3 -h now

and then issue

kill -1 1

to tell the system about it.

If your windowmanager/KDE/Gnome catches Ctrl-Alt-Del you can, of course, first switch to a virtual console (or exit X).

Offline

#8 2004-02-23 20:40:43

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 706
Website

Re: Halt and Reboot from normal user [wiki]

The alt-ctrl-delete works, but is there some way I can get halt to work from command line?  halt's permissions are set so anyone can use it, but the superuser check is inside the halt program.  Is there a solution?


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#9 2004-02-24 14:05:18

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Halt and Reboot from normal user [wiki]

See my previous and Xentac's post for the answer...

Offline

#10 2004-02-29 01:51:40

slyski
Member
From: Cheese Head Land
Registered: 2004-01-11
Posts: 60

Re: Halt and Reboot from normal user [wiki]

i did the setuid on the halt binary.

simple and fast and worked like a dream

thanks i3839

slyski


Joey: If a cow passes away from natural causes can I eat it.
Pheobe: Not if I get there first.

Offline

Board footer

Powered by FluxBB