LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-23-2003, 03:29 PM   #1
InsaneBob
Member
 
Registered: Mar 2003
Posts: 105

Rep: Reputation: 15
Normal User Restart and Shutdown


When I log in as root I noticed that I can restart and shutdown through gnome. How can I set it up so a normal user can restart and shutdown?
 
Old 08-23-2003, 03:35 PM   #2
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 31
Look into sudo, it lets a user run a command as root.:

man sudo.

What you should do is put an entry in the /etc/sudoers file like this:

InsaneBob ALL = (ALL) NOPASSWD: ALL

or not necessarily all, if that's not what you want [you can set up a command alias], although the nopasswd option is useful. Then, the user can:

sudo /sbin/shutdown -h now

or whatever. You could set up a script to do this if you don't want to type it every time.

Of course, the other option would be to chmod 777 the /sbin/shutdown script, and then you could just run
/sbin/shutdown -h now, without all the sudo hassle. However, this does pose security risks, and is not the correct solution if you only want to enable this access to one user.

Last edited by andrewlkho; 08-23-2003 at 03:37 PM.
 
Old 08-23-2003, 06:47 PM   #3
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
You could also create a shutdown group and add the users you want to that and assign ownership of /sbin/shutdown to the shutdown group.

info:
man group
man groupadd
man chgrp
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can normal user use shutdown command? sorno Linux - Newbie 2 07-30-2005 07:11 AM
Normal User to restart syslog server lier74ok Linux - Security 2 05-12-2005 01:23 AM
normal user running shutdown cblamer Slackware 6 12-21-2003 09:44 PM
can normal user do shutdown? TheOneAndOnlySM Slackware 12 12-18-2003 12:10 AM
Disable reboot/halt/shutdown as normal user carstenbjensen Mandriva 4 09-09-2003 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration