Page 1 of 2

Allow users to shutdown computer from a window manager

PostPosted: February 20th, 2011, 10:16 am
by mojoman
Anything related to the howto: Allow users to shutdown computer from a window manager can be posted in this thread.

Re: Allow users to shutdown computer from a window manager

PostPosted: February 20th, 2011, 12:07 pm
by fsmithred
xfce4 gives the user a quit button that has all the options (log out, reboot, shut down, hibernate, suspend). No special group membership is required.

Re: Allow users to shutdown computer from a window manager

PostPosted: February 20th, 2011, 12:32 pm
by mojoman
fsmithred wrote:xfce4 gives the user a quit button that has all the options (log out, reboot, shut down, hibernate, suspend). No special group membership is required.


Ok, good to hear. In earlier versions some of those buttons were shadowed. It might still be an issue depending on what version you're running. http://wiki.xfce.org/faq#session_manager

EDIT: I see that that this is from version 4.4 so Lenny and after shouldn't need this. However, I found an old thread about this and as late as Xfce 4.2 this was a problem. I'll update the howto. Thanks for pointing this out.

Re: Allow users to shutdown computer from a window manager

PostPosted: February 21st, 2011, 11:18 pm
by cynwulf
I'm sure it was a problem in lenny with gdm as display manager. All the buttons were greyed out except exit/quit.

I have tested out and works great in openbox, I went for the lazy approach and used obmenu to generate menu options for shutdown and reboot. Works perfectly - thanks.

Re: Allow users to shutdown computer from a window manager

PostPosted: September 26th, 2013, 8:40 pm
by stevesr0
Followed the how-to and can log out from a terminal emulator without entering password, but not from obmenu.

There are new entries for reboot and shutdown, since i edited the openbox menu.xml file, but nothing happens.

Steve

correction: whenI initially boot, the sudo shutdown command requires me to provide my password.

If I launch visudo and save the sudoers file (without editing it), the /sbin/shutdown command works from the terminal emulator.

Re: Allow users to shutdown computer from a window manager

PostPosted: October 3rd, 2013, 4:25 am
by sqlpython
@stevesr0
If you would like to see a shutdown or reboot from an OpenBox menu on desktop.... try #!CrunchBang..
For that matter you could call the CB-script from a terminal fro the same results.
#!CrunchBang has a number specialized scripts which allow many variables from OpenBox.

Re: Allow users to shutdown computer from a window manager

PostPosted: October 3rd, 2013, 7:56 am
by cynwulf
I don't believe there's any need to change distro just to be able to shut down...?

If sudo is asking for a password, then the problem is in how you've set up sudo.

Re: Allow users to shutdown computer from a window manager

PostPosted: October 4th, 2013, 1:23 am
by sqlpython
:^)
No, I am just suggesting if he would...
If you would like to see

And implemented without Sudo..
Exam the scripts and borrow something from them..
Learning is good..

Re: Allow users to shutdown computer from a window manager

PostPosted: October 9th, 2013, 5:09 pm
by stevesr0
@cynwulf,

I think it is not a sudo issue, but policykit blocking sudo.

I am turning over how best to deal with the multitude of programs that are all dealing with permissions (sudo, PAM, policykit,...).

Thanks for responses.

Re: Allow users to shutdown computer from a window manager

PostPosted: January 26th, 2014, 9:06 pm
by babak_tour
Hi.
I am using Lubuntu 13.10 with Openbox. I follow "How to" but It doesn't work.
It's my sudoers content:
Code: Select all
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias      SHUTDOWN = /sbin/shutdown

# User privilege specification
#root   ALL=(ALL:ALL) ALL
babak ALL=SHUTDOWN
babak ALL=NOPASSWD: SHUTDOWN
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d