LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-15-2004, 07:51 AM   #1
mikedelo
Member
 
Registered: Mar 2004
Location: Staten Island, NY
Distribution: MX Linux
Posts: 62

Rep: Reputation: 0
shutdown command


How do you give other users rights to shutting down the system using the following command: 'shutdown -h now'? Right now, I have to log in as root and shut it down, but I would like to give rights to my users (family). I currently use RH Fedora.

Thank you,
Michael R. DeLorenzo
 
Old 03-15-2004, 07:55 AM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
/sbin/halt does the same thing. You can get it so anyone can run it by changing it suid root (which means it always runs as root, nomatter who runs it). Do that by typing:
Code:
chmod +s /sbin/halt
 
Old 03-15-2004, 07:57 AM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
Shutdown is meant to be run by root, which tells all other users and procs that the system is going down. Read ->
$ man shutdown
I don't know if a user could execute it, and don't think one should, but...
 
Old 03-15-2004, 08:00 AM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
If he knows that his family are the only other users on the computer then setting /sbin/shutdown or /sbin/halt to run suid root shouldn't be an issue.
 
Old 03-15-2004, 08:02 AM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
I'm a purist. If I want to manipulate the box to work wacky, I'll go back to Mirco$loth
and always "login as root," so to speak. :}
 
Old 03-15-2004, 08:03 AM   #6
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
So you suggest his family either have to ask him to shutdown the computer for them, meaning they can't turn it off if he's not present, or just press the power button? So, without them being able to run 'shutdown' how do you propose they switch the machine off??
 
Old 03-15-2004, 08:28 AM   #7
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 31
You shouldn't alter the permissions on the shutdown script - it's in the sbin directory, so it should keep those permissions. Instead, what you should do is use sudo to allow them to run this command...
 
Old 03-15-2004, 08:37 AM   #8
bulzbb
Member
 
Registered: Feb 2004
Posts: 50

Rep: Reputation: 15
Hi, hope this help.

If you have sudo installed, then you can add users (or groups) in /etc/sudoers

You can add something like:
#to give a group the right to shutdown
%group_name localhost=/sbin/shutdown -h now
#to give a user the right to shutdown
user_name localhost=/sbin/shutdown -h now

The user then need to execute sudo followed by the command. When asked for a password, it's their own password (not the root). check man sudo too.

Cheers
 
  


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
Shutdown command? MikeZila Linux - Newbie 7 07-27-2008 05:09 PM
shutdown command xviddivxoggmp3 Red Hat 5 05-12-2004 04:48 PM
shutdown command Oakstaff Linux - Newbie 8 11-18-2003 09:47 PM
shutdown command nelly_boy Linux - Software 11 08-03-2003 06:04 AM
Shutdown Command? AMDPwred Linux - General 1 01-25-2002 08:43 PM

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

All times are GMT -5. The time now is 04:02 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