Allow users to shutdown computer from a window manager

Discuss a HowTo.

Moderator: How-to Curator

Re: Allow users to shutdown computer from a window manager

Postby babak_tour » January 28th, 2014, 8:25 pm

I use a better way.
I write a file with this content:
Code: Select all
#!/bin/bash
echo "mypasswd"|sudo -S /sbin/shutdown -r now

and add execute permission. Then set its addresses in menu.xml.
babak_tour
 
Posts: 4
Joined: January 26th, 2014, 8:56 pm

Re: Allow users to shutdown computer from a window manager

Postby notthatguy » January 28th, 2014, 8:53 pm

babak_tour wrote:I am using Lubuntu 13.10 with Openbox. I follow "How to" but It doesn't work.


I REALLY doubt the howto would be posted if it did not work.That being said it is a debian howto and I would not be surprised if LuserBuntu screws something up that makes it not work. I suspect your sudo entries should of been at the bottom of the file. Even better would be to put them in a seperate file in /etc/sudoers.d/ as the config file mentions.

babak_tour wrote:I use a better way.

How is that better?


Feels like I just stumbled into FDN!
User avatar
notthatguy
 
Posts: 697
Joined: February 27th, 2011, 4:42 pm

Re: Allow users to shutdown computer from a window manager

Postby babak_tour » January 29th, 2014, 8:50 pm

I think it must works properly, because lubuntu is a debian base distro.
I don't know the reason that it doesn't work.

And the second is better, because it's simpller than first. But it's not secure way.
I use an other way finally:
http://andrusiv.com/blog/2011/12/12/shutdown-dbus.html
babak_tour
 
Posts: 4
Joined: January 26th, 2014, 8:56 pm

Re: Allow users to shutdown computer from a window manager

Postby cynwulf » January 29th, 2014, 10:43 pm

babak_tour wrote:But it's not secure way.

And that's the understatement of the year.
cynwulf
 
Posts: 2548
Joined: April 26th, 2011, 2:46 pm

Re: Allow users to shutdown computer from a window manager

Postby notthatguy » January 30th, 2014, 2:25 am

babak_tour wrote:I think it must works properly, because lubuntu is a debian base distro.

That doesn't guarantee that a howto written for debian will work properly on it.

I don't know the reason that it doesn't work.

The method works fine.

And the second is better, because it's simpller than first. But it's not secure way.

How is that simpler?
User avatar
notthatguy
 
Posts: 697
Joined: February 27th, 2011, 4:42 pm

Re: Allow users to shutdown computer from a window manager

Postby babak_tour » January 30th, 2014, 2:44 pm

cynwulf wrote:
babak_tour wrote:But it's not secure way.

And that's the understatement of the year.


Why? If you write your passworld in a file, is secure?

How is that simpler?


It's a simple bash file that can be written in a few seconds and can be stored anywhere.
And sudoers file does not need to change.
babak_tour
 
Posts: 4
Joined: January 26th, 2014, 8:56 pm

Re: Allow users to shutdown computer from a window manager

Postby cynwulf » January 30th, 2014, 3:42 pm

babak_tour wrote:Why? If you write your passworld in a file, is secure?

No.
cynwulf
 
Posts: 2548
Joined: April 26th, 2011, 2:46 pm

Previous

Return to HowTo Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x