LinuxQuestions.org
Help answer threads with 0 replies.
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, 05: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, 05: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, 06:18 AM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,899

Rep: Reputation: 68
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, 06: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


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
MASSCOOL PCI-e 2 serial + 1 print Card Model XWT-PCIE05 doesn't allow normal poweroff lkraemer Linux - Hardware 1 08-04-2008 04:38 AM
Poweroff as user Murdock1979 Slackware 18 07-21-2008 06:18 AM
Poweroff computer as normal user ladio Linux - General 1 11-26-2007 04:42 AM
poweroff and shutdown with own user jaakkop Linux - General 6 12-29-2005 11:07 PM
poweroff with own user jaakkop Linux - General 2 12-28-2004 08:07 AM


All times are GMT -5. The time now is 12:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration