You are not logged in.

#1 2005-11-19 17:28:46

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,252

How to let normal users shutdown - from a newbie

adapted from this

While there is some info in the wiki about allowing users to perform root tasks, i didn't like the way it was done and looked for another way.

After searching i used part of the instructions in the above link to allow a normal user to execute shutdown & poweroff from konsole and firestarter .
(i use KDE)

As root do these :

1 - create a group called powerusers (or a name of your choosing), add everyone who should have access to these commands to this group

2 - run

pacman -S sudo

3 - run

visudo

go into edit mode with :s and add these lines :

%powerusers ALL = (root) NOPASSWD: /opt/gnome/bin/firestarter
%powerusers ALL = (root) NOPASSWD: /sbin/poweroff
%powerusers ALL = (root) NOPASSWD: /sbin/reboot

exit visudo with :wq

4 create 3 shell scripts in /bin
example script for reboot 

#! /bin/sh
sudo /sbin/reboot $*

make sure the scipts are executable, and change the group for the scripts  to powerusers .

-------------------------------------------------------
Since i consider myself still a linux / arch newbie, i would like comments to this approach.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2005-11-19 17:55:01

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: How to let normal users shutdown - from a newbie

There's nothing wrong with those instructions. I generally don't go that far since I don't personally have many users. I just give each user the access under sudo instead of making a group, and I create an alias in their ~/.bashrc instead of creating a shellscript, but the gist is the same.

Dusty

Offline

#3 2005-11-20 18:48:19

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,252

Re: How to let normal users shutdown - from a newbie

Thanks, Dusty.

I tried the alias in ~/.bashrc also, and it works fine.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB