LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-12-2003, 03:20 AM   #1
gagan_fzks
LQ Newbie
 
Registered: Nov 2003
Location: India
Posts: 5

Rep: Reputation: 0
how to give a user right to shutdown


I'm working in an office nad so I cannot give root password to anyone in the office. So I have created a user in my linux which has some rights to work on machine. But i don't know how to give that user the right to shutdown or reboot the machine. Would anyone help me in this. thanx in advance
 
Old 11-12-2003, 03:32 AM   #2
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
well the convoluted way i'd go about doing it is to find out where shutdown and halt are at using the whereis command (for me the ones to look at are in /sbin). anyway, create a group, add the users you want to be able to shutdown/halt to that group, use chgrp on those files to the name of your new shutdown group, and then chmod those files to allow exec permissions for group. that should do it. if you want to keep your new user for shutdown, you'll have to edit the sudo file. i guess man sudo for that.

edit: for me, the basic commands that you're used to using (/usr/bin/poweroff, /usr/bin/reboot, etc...) are just links to halt, shutdown, or consolehelper (which maybe just a redhat thing).

Last edited by megaspaz; 11-12-2003 at 03:37 AM.
 
Old 11-12-2003, 05:32 AM   #3
ceedeedoos
Member
 
Registered: Aug 2003
Location: Antwerp, Belgium
Distribution: Slackware 10.0, Mandrake 10.1
Posts: 174

Rep: Reputation: 36
man sudo, man sudoers, man visudo

I have this line to let the users of my laptop do a poweroff without giving a password.
%users laptop = NOPASSWD: /sbin/poweroff
 
Old 11-12-2003, 06:55 AM   #4
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Rep: Reputation: 30
Is there a way to list all groups in linux ? I'm looking for a command that can perform such task.
 
Old 11-12-2003, 07:59 AM   #5
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Rep: Reputation: 30
I think it is dangerous giving permission to everyone in server as well. My method is:

- make a group called "logoff"
- change "halt" to group logoff (chown root:logoff halt)
- chmod 4750 halt

so root and people of group has permission to shut down the computer (halt -p)

(in fact I am not sure if the command work in linux, I am in bsd right now)
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I give myself root priv's as a user? Mr. Hill Linux - Newbie 9 06-12-2005 02:19 PM
logout wont give shutdown option etim Linux - Software 9 04-11-2005 04:39 PM
give user SU to access evrything? OverrRyde Mandriva 8 08-05-2004 01:58 PM
Give root priviligies to an user Skululu Red Hat 7 03-06-2004 08:11 AM
how to give a user right to shutdown? gagan_fzks Linux - General 3 11-12-2003 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:12 PM.

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