You are not logged in.
Hi, I'm installing Arch and openbox on my fathers laptop. I want to make a menu entry that shuts down the computer, without requiring password, but when launching shutdown as a normal user i get
$ shutdown
shutdown: you must be root to do that
I don't want to install sudo and give him sudo privilegies, so I cannot use sudo and sudo=nopasswd for him.
It didn't help to chmod +x either, as it seems like it is something in the /sbin/shutdown program that hates everybody but root.
Last edited by hatten (2010-02-07 11:06:17)
Offline
Have you checked aur? there seems to be some packages that do what you want to do. Search for: shutdown
Offline
Hi, I'm installing Arch and openbox on my fathers laptop. I want to make a menu entry that shuts down the computer, without requiring password, but when launching shutdown as a normal user i get
$ shutdown shutdown: you must be root to do that
I don't want to install sudo and give him sudo privilegies, so I cannot use sudo and sudo=nopasswd for him.
It didn't help to chmod +x either, as it seems like it is something in the /sbin/shutdown program that hates everybody but root.
I made a couple of entries in my .bashrc
alias halt='sudo halt'
alias reboot='sudo reboot'
alias hibernate='sudo pm-hibernate'
alias suspend='sudo pm-suspend'
Offcourse you have to edit your sudoers file to execute the commands without entering a password.
Arch x86_64 on HP 6820s and on HP nx9420. Registered Linux User 350155, since 24-03-2004
"Everyone said that it could not be done, until someone came along who didn't know that."
Offline
I don't want to install sudo and give him sudo privilegies
Installing sudo does not give anyone sudo privileges - configuring it does. Set it up to give him access to 'sudo shutdown' only.
Offline
hatten wrote:I don't want to install sudo and give him sudo privilegies
Installing sudo does not give anyone sudo privileges - configuring it does. Set it up to give him access to 'sudo shutdown' only.
ah well, it's still another package on the system. I'll check AUR too and see if I find something nice and simple.
Offline
If you have installed dbus, try this
Entry = "reboot ..." { Actions = "Exec dbus-send --system --print-reply --dest='org.freedesktop.Hal' /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot" &}
Entry = "shutdown" { Actions = "Exec dbus-send --system --print-reply --dest='org.freedesktop.Hal' /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown" &}
I use this in pekwm and I'm able to reboot / shutdown as USER with any password or sudo.
Jean-Paul
Last edited by jean-paul (2010-01-28 22:23:40)
I'm root. if you see me smile, you'd better have a backup!!
Offline
hal is being deprecated, so the correct way to shutdown with dbus is using consolekit. However I suspect hatten won't have it installed if he is that reluctant to install even sudo...
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
I think you just need to add yourself to the power group. Have a look at the wiki. And if still doesn't work add ck-launch-session in your xinit.
http://wiki.archlinux.org/index.php/LXD … _from_LXDE
http://wiki.archlinux.org/index.php/GNO … GNOME_menu
Last edited by lymphatik (2010-01-29 14:40:58)
Offline
I think you just need to add yourself to the power group. Have a look at the wiki. And if still doesn't work add ck-launch-session in your xinit.
http://wiki.archlinux.org/index.php/LXD … _from_LXDE
http://wiki.archlinux.org/index.php/GNO … GNOME_menu
I'll try the first option, if that doesn't work I'll go with sudo
@PirateJonno; I have dbus installed, but it's always more interesting to try and solve things without installing additional packages, no matter how small they are. =p
Offline
Pressing the power button for a few seconds usually works for "users"
Offline
Pressing the power button for a few seconds usually works for "users"
lmao, not with a computer I'm fixing!
Offline
See thread.
It's a mess. Raving lunatics are the only people who write this crap for free, because the competent devs get paid good money for writing for Windows
Offline
Pressing the power button for a few seconds usually works for "users"
Well if that's how you 'shut down' your computer I think we'll see a lot of topics from your side in the future.
You don't push the power button for a few seconds unless you do a hard shutdown. You can set up an ACPI action - either through your DE's backend or through ACPI directly - to shut down cleanly, but that only involves pushing that button once, and certainly not more than a second. You push, you release. You do not hold.
I repeat: You do not hold.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
See http://bbs.archlinux.org/viewtopic.php? … 26#p680826 for using consolekit/devicekit, and http://bbs.archlinux.org/viewtopic.php? … 13#p680513 for using hal.
Offline
devicekit? hal?
what about simple ACL?
1) create group e.g. shutdown
2) give it rights you want
3) assign group shutdown to /sbin/halt
4) configure access
5) run:
halt -p
to poweroff machine
this is simple old way that works without weird scripts invoking hal or whateverkit.
no need for sudo either if you don't want to install it
hope this will help
Last edited by broch (2010-02-04 04:29:39)
Offline
what about simple ACL?
1) create group e.g. shutdown
2) give it rights you want
3) assign group shutdown to /sbin/halt
4) configure access
5) run:
halt -p
to poweroff machinethis is simple old way that works without weird scripts invoking hal or whateverkit.
no need for sudo either if you don't want to install it
Did not work for me. I followed your steps but with the "power" group.
> ls /sbin/halt
-rwxr-xr-x 1 root power 9,9K abr 30 2009 /sbin/halt
> reboot
reboot: must be superuser.
Offline
run:
chmod u+s /sbin/shutdown
to get
ls -l /sbin/halt
-rwsr-x--- 1 root shutdown 9.9K Apr 30 2009 /sbin/halt
shutdown group (you) must run program with root privileges, then it will work
hope this will help
Offline
man sudoers
Offline
man sudoers
...
ant the title says:
Is it possible to shutdown as user without sudo?
Offline
I went with the simple sudo chmod +s, it's a single user system that's regularly updated so I'm not especially afraid of unwanted shutdowns.
But thanks for all suggestions, I'll maybe need them some day!
Offline
run:
chmod u+s /sbin/shutdown
to get
ls -l /sbin/halt
-rwsr-x--- 1 root shutdown 9.9K Apr 30 2009 /sbin/haltshutdown group (you) must run program with root privileges, then it will work
hope this will help
I'm surely doing something obvious wrong.
with root:
> ls /sbin/shutdown
-rwsr-s--- 1 root power 18K abr 30 2009 /sbin/shutdown
with my user:
> reboot
reboot: must be superuser.
(my user belongs to "power")
Offline
mm..
you have not set executable permission so user will not be able to execute command:
mine:
ls -l /sbin/halt
-rwsr-x--- 1 root shutdown 9.9K Apr 30 2009 /sbin/halt
yours:
ls /sbin/shutdown
-rwsr-s--- 1 root power 18K abr 30 2009 /sbin/shutdown
anyway, I suggest to modify ACL for /sbin/halt
it is useful
other that this, I am not sure what to suggest.
Once you set ownership correctly reboot and poweroff works: from terminal window, from console. Does not matter user can shutdown machine without providing root password or using sudo.
You can also try hatten's suggestion (#20)
I am sorry that this is not working for you but I don't know how else
Offline
Many thanks; it worked.
hatten: consider editing the title of the first post for adding [SOLVED] at the beginning.
Offline
Many thanks; it worked.
hatten: consider editing the title of the first post for adding [SOLVED] at the beginning.
ah sorry, done.
Offline