Allow users to shutdown computer from a window manager

Discuss a HowTo.

Moderator: How-to Curator

Allow users to shutdown computer from a window manager

Postby mojoman » February 20th, 2011, 10:16 am

Anything related to the howto: Allow users to shutdown computer from a window manager can be posted in this thread.
Seriously, Stable is for senior citizens and Sid is for kids. Be a man and run Testing.
User avatar
mojoman
 
Posts: 427
Joined: February 9th, 2011, 12:33 pm
Location: In the neck of the wood

Re: Allow users to shutdown computer from a window manager

Postby fsmithred » February 20th, 2011, 12:07 pm

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.
fsmithred
 
Posts: 361
Joined: February 11th, 2011, 4:14 am

Re: Allow users to shutdown computer from a window manager

Postby mojoman » February 20th, 2011, 12:32 pm

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.
Seriously, Stable is for senior citizens and Sid is for kids. Be a man and run Testing.
User avatar
mojoman
 
Posts: 427
Joined: February 9th, 2011, 12:33 pm
Location: In the neck of the wood

Re: Allow users to shutdown computer from a window manager

Postby cynwulf » February 21st, 2011, 11:18 pm

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.
cynwulf
 
Posts: 2548
Joined: April 26th, 2011, 2:46 pm

Re: Allow users to shutdown computer from a window manager

Postby stevesr0 » September 26th, 2013, 8:40 pm

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.
stevesr0
 
Posts: 2
Joined: September 26th, 2013, 8:10 pm

Re: Allow users to shutdown computer from a window manager

Postby sqlpython » October 3rd, 2013, 4:25 am

@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.
sqlpython
 
Posts: 3
Joined: July 15th, 2013, 2:37 am

Re: Allow users to shutdown computer from a window manager

Postby cynwulf » October 3rd, 2013, 7:56 am

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.
cynwulf
 
Posts: 2548
Joined: April 26th, 2011, 2:46 pm

Re: Allow users to shutdown computer from a window manager

Postby sqlpython » October 4th, 2013, 1:23 am

:^)
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..
sqlpython
 
Posts: 3
Joined: July 15th, 2013, 2:37 am

Re: Allow users to shutdown computer from a window manager

Postby stevesr0 » October 9th, 2013, 5:09 pm

@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.
stevesr0
 
Posts: 2
Joined: September 26th, 2013, 8:10 pm

Re: Allow users to shutdown computer from a window manager

Postby babak_tour » January 26th, 2014, 9:06 pm

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
babak_tour
 
Posts: 4
Joined: January 26th, 2014, 8:56 pm

Next

Return to HowTo Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

x