LinuxQuestions.org
Review your favorite Linux distribution.
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 01-15-2004, 07:27 AM   #1
quwaie
LQ Newbie
 
Registered: Dec 2003
Location: Saudi Arabia
Distribution: Fedora
Posts: 12

Rep: Reputation: 0
Question Non-Root User


Dear all,

How to allow the Non-Root user to do shutdown?

Using RedHat

Help Me Pleas....

Best Regards,
Mohammad A. Al Quwaie
Saudi Arabia

Last edited by quwaie; 01-15-2004 at 07:32 AM.
 
Old 01-15-2004, 07:53 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Change the permissions on the shutdown command with:

# chmod 755 /sbin/shutdown

I think that should work, but if it doesn't run:

# chmod 4755 /sbin/shutdown

Last edited by kilgoretrout; 01-15-2004 at 07:55 AM.
 
Old 01-15-2004, 09:36 AM   #3
quwaie
LQ Newbie
 
Registered: Dec 2003
Location: Saudi Arabia
Distribution: Fedora
Posts: 12

Original Poster
Rep: Reputation: 0
Dear,

I have Changed the permissions, but still i couldn't do shutdown by
Non-Root user.

Regards,
 
Old 01-15-2004, 09:59 AM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
i think redhat sets up ctrl-alt-delete to do a shutdown but i might be wrong. the only reason i can think of for "chmod 4755 /sbin/shutdown" not to work is if the binary wasnt owned by root, what is the output of "ls -l /sbin/shutdown"?
 
Old 01-15-2004, 10:11 AM   #5
quwaie
LQ Newbie
 
Registered: Dec 2003
Location: Saudi Arabia
Distribution: Fedora
Posts: 12

Original Poster
Rep: Reputation: 0
The output is : -rwsr-xr-x
 
Old 01-15-2004, 10:29 AM   #6
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
sorry i meant the whole output, i want to know who owns the binary, eg heres mine

Code:
-rwxr-xr-x    1 root     bin         15224 Jun 19  2002 /sbin/shutdown
here root is the owner is the file and bin is the group of the file
 
Old 01-15-2004, 03:11 PM   #7
rmanocha
Member
 
Registered: Oct 2003
Location: Austin,TX
Distribution: Debian SID-->fully content-->Love APT,kernel 2.6.4
Posts: 327

Rep: Reputation: 30
you could give the user sudo access to the shutdown command.
sudo is a program which lets a user execute a command as another user.
i would think this method as easier and more secure than changing the permissions of the shutdown command as other people would be able to use the command too if you make it executable for all.
you should probably have sudo with your distribution.just read the ma pages for sudo and then edit the sudoers file accordingly.
let me know if you need more help.
 
Old 01-15-2004, 03:13 PM   #8
quwaie
LQ Newbie
 
Registered: Dec 2003
Location: Saudi Arabia
Distribution: Fedora
Posts: 12

Original Poster
Rep: Reputation: 0
Code:
-rwsr-xr-x    1 root     root     15585 jan 15 15:22 /sbin/shutdown
 
Old 01-15-2004, 03:21 PM   #9
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
and with that normal users cant shutdown? there must be something else getting in the way - possibly pam. what is the error you get when you try to shutdown as a normal user.
 
Old 01-16-2004, 01:03 AM   #10
quwaie
LQ Newbie
 
Registered: Dec 2003
Location: Saudi Arabia
Distribution: Fedora
Posts: 12

Original Poster
Rep: Reputation: 0
I am here again,

kev82,

The error MSG is : -bash : shutdown: Command not found

rmanocha,

sudo good idea , and that's what i need....YES

I have played with it visudo , but I'am not good in editing

Kindly please advice me what to do Step by Step


Thank you all 4 your fast action.


Mohammad
 
Old 01-16-2004, 02:14 AM   #11
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
In redhat you have to run:

$ /sbin/shutdown

Not:

$ shutdown
 
Old 01-16-2004, 09:22 AM   #12
quwaie
LQ Newbie
 
Registered: Dec 2003
Location: Saudi Arabia
Distribution: Fedora
Posts: 12

Original Poster
Rep: Reputation: 0
sorry, i have posted by mistake.

Last edited by quwaie; 01-16-2004 at 09:23 AM.
 
Old 01-16-2004, 10:56 AM   #13
rmanocha
Member
 
Registered: Oct 2003
Location: Austin,TX
Distribution: Debian SID-->fully content-->Love APT,kernel 2.6.4
Posts: 327

Rep: Reputation: 30
i am not very sure about the sudoers file but i believe that to give say user xyz permission to execute shutdown what you have to put in sudoers is:
xyz ALL = /sbin/shutdown

i think this should do it.you should read up on the documentation given for the sudoers file:
man sudoers
i hope this helps.
 
Old 02-25-2004, 07:18 PM   #14
Salpula
Member
 
Registered: Feb 2004
Location: Philadelphia, PA
Distribution: FC3 i386 & PPC
Posts: 36

Rep: Reputation: 15
Lightbulb Another Option

I ran into the same issue with red hat 9, I got around by simply doing an SU before shutting down or using "halt". Halting the system sends all processes a SIGTERM and then a SIGKILL and unmounts all drives before stopping the system.
 
  


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
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM
Scanner to work as USER and not forced as ROOT Root (Suse 9.1) 1kyle Linux - Hardware 0 07-10-2004 08:51 AM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-07-2004 11:11 PM
IntelliMouse thumb buttons work as root, broken as non-root user, wheel works always digital vortex Linux - Hardware 7 03-02-2004 04:14 PM
Why does kppp.desktop require root userid for non-root user? rdaves@earthlink.net Linux - Networking 4 08-27-2001 09:18 AM

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

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