You are not logged in.

#1 2007-05-12 12:47:07

ProzacR
Member
Registered: 2007-04-29
Posts: 272

poweroff without root?

I want to use poweroff command from my user. How can I do that?

Offline

#2 2007-05-12 13:25:30

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: poweroff without root?

Read about sudo.

Offline

#3 2007-05-12 13:30:55

ProzacR
Member
Registered: 2007-04-29
Posts: 272

Re: poweroff without root?

Mmm I know about sudo, but I do not like sudo.
Can I do this in other way? Without sudo and without root?

Offline

#4 2007-05-12 13:36:27

havli
Member
From: Czech Republic
Registered: 2005-04-28
Posts: 7

Re: poweroff without root?

There are more possibilities:
1) change file permissions for the halt command (as root)

chmod +s /sbin/halt

2) using sudo -> add to /etc/sudoers with visudo (as root)

user hostname = NOPASSWD: /sbin/shutdown -h now

After that you can as user shutdown with

sudo shutdown -h now

Offline

#5 2007-05-12 14:18:23

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: poweroff without root?

What about pressing Ctrl+Alt+Del? Just modify your inittab to execute `shutdown -h now' (or something like that) on pressing it:

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

Offline

Board footer

Powered by FluxBB