LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2008, 04:21 AM   #1
ajayan
Member
 
Registered: Dec 2007
Posts: 89

Rep: Reputation: 16
Poweroff as a normal user


Dear All,
i wrote a shell script to poweroff all my machines in my lab, In my lab every machines hold a student user account.Due to some reasons i am setting up this script to run as student user.But in some rhel-4 machines the output of the script shows "poweroff: must be superuser".what is the problem? how can i poweroff my machine while login as a normal user (without setting sudo).?.


Advaned Thanks
 
Old 10-28-2008, 04:39 AM   #2
m_w_sundaram
LQ Newbie
 
Registered: Feb 2004
Location: YERCAUD
Posts: 6

Rep: Reputation: 0
Lightbulb It's all about chaging the permission

Dear friend,

You can simply do it by changing the permission of poweroff command.

as root execute the following commands.
# whereis poweroff
<you will get the path of the command>
# chmod u+x /usr/bin/poweroff

try it out
 
Old 10-28-2008, 05:18 AM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Code:
chmod u+s /usr/bin/poweroff
should make poweroff run as superuser even when run by normal user. "u+x" is not needed, as the error message is printed y poweroff itself anyway.
 
Old 10-28-2008, 05:47 AM   #4
ajayan
Member
 
Registered: Dec 2007
Posts: 89

Original Poster
Rep: Reputation: 16
Thanks

Quote:
Originally Posted by raskin View Post
Code:
chmod u+s /usr/bin/poweroff
should make poweroff run as superuser even when run by normal user. "u+x" is not needed, as the error message is printed y poweroff itself anyway.
THANKS VERY MUCH THAT WORKS!!!!!!!!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
MASSCOOL PCI-e 2 serial + 1 print Card Model XWT-PCIE05 doesn't allow normal poweroff lkraemer Linux - Hardware 1 08-04-2008 03:38 AM
Poweroff as user Murdock1979 Slackware 18 07-21-2008 05:18 AM
Poweroff computer as normal user ladio Linux - General 1 11-26-2007 03:42 AM
poweroff and shutdown with own user jaakkop Linux - General 6 12-29-2005 10:07 PM
poweroff with own user jaakkop Linux - General 2 12-28-2004 07:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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