Shutting down as a normal user
I know this has been asked before, but I just wanted to clarify things.
Is there any way to shutdown as a normal user without changing permissions? I don't want to press ctrl+alt+del or the power button. If I add a user to the power group on slackware, will that user have access to shutdown frm the commandline by running /sbin/shutdown -h now? Or is the power group only used by DE's? Is the only remaining solution to use sudo, other than manually changing permissions on the shutdown executable? |
Quote:
I am unsure what the power group actually does on slackware so I am at a loss to answer that question but the only way that I am aware of is to allow the user to use sudo to shutdown the machine. You can limit there use of sudo for only this task however instead of giving every user access to everything via sudo, which IMHO I do not understand why distros allow all users access to everything via sudo. Seams like a bad idea from a security standpoint. |
If you are at runlevel 4, kdm will let you shut down/poweroff the machine. You don't have to be root (in fact, you aren't anyone since you aren't logged in).
|
Sorry, I should have said I mean from the commandline. I don't use KDE or Gnome or XFCE, and was just after a commandline solution.
|
Ah.
As root: Code:
visudo You'll still have to use the command... Code:
sudo /sbin/shutdown -h now The above line restricts the command to members of the power group. "man sudoers" tells you more than you'd want to know about the sudoers file. |
I'm more than familiar with sudo, I was just hoping there was a solution that didn't rely on it.
|
Hi,
You can use a symlink, as /sbin/halt runs with setuid Code:
ln -s /sbin/poweroff /usr/bin |
Quote:
Code:
x@x:~$ ls -l /sbin/poweroff Quote:
|
In case anyone using XFCE is wondering about this, adding a user to the power group in Slackware will allow regular users to shutdown the computer from the desktop in XFCE. I forget why exactly this does not work in KDE.
|
If you are a member of the power group, you can shutdown from the command line with:
Code:
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown |
Excellent!
|
Or you can just press the off switch on your computer it is set to shut down gracefully.
samac |
Yep! it works
samac |
Unfortunatly, pressing the power button is not at all a solution.
The dbus command works,,,,it will be kind of a long alias, but if it gets the job done......:) |
Why not just put it in a script?
|
All times are GMT -5. The time now is 06:50 PM. |