Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Shutting down gentoo without being root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Avenger902
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2004
Posts: 95

PostPosted: Tue Oct 05, 2004 4:51 am    Post subject: Shutting down gentoo without being root Reply with quote

Well I am happy to say I am a proud user of Gentoo Linux and if it wasn't for this distro I wouldn't be using Linux at all...

Anyhow even though I like it, I was wondering if there is a way I can use the poweroff and reboot commands with a user other then going to super user mode everytime....

Thanks in Advance
Back to top
View user's profile Send private message
morpheus2485
n00b
n00b


Joined: 08 Jul 2004
Posts: 14
Location: Sonora Ca

PostPosted: Tue Oct 05, 2004 5:06 am    Post subject: Reply with quote

sudo?
_________________
hp pavilion zt3000
kernel 2.6.7 - gentoo - kde
ati radeon mobility 9000
pentium Mobile 1.4ghz
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Tue Oct 05, 2004 2:09 pm    Post subject: Reply with quote

Easy, here is how I do it:
Code:
emerge sudo
Now (as root) enter the command
Code:
visudo
in order to bring up your sudoers file. Leave everything as it is, but add the lines
Code:
%users  ALL= NOPASSWD: /sbin/shutdown -h now
 %users  ALL= NOPASSWD: /sbin/shutdown -r now
This should allow any user to use the commands
Code:
sudo /sbin/shutdown -h now
to poweroff the system and
Code:
sudo /sbin/shutdown -r now
to reboot the system. All you have to do is either make user aliases in your ~/.bashrc for 'poweroff' and 'reboot' or simply add the above lines to your WMs menu somewhere.
Back to top
View user's profile Send private message
Avenger902
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2004
Posts: 95

PostPosted: Tue Oct 05, 2004 2:56 pm    Post subject: Reply with quote

Thank you so much ChunderBunny! It works perfectly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum