LinuxQuestions.org
Visit Jeremy's Blog.
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 04-02-2012, 09:56 PM   #1
fxbszj
LQ Newbie
 
Registered: Dec 2011
Distribution: Fedora,RHEL5.4
Posts: 5

Rep: Reputation: Disabled
How to shutdown without the root password


How to set up so that Redhat can shutdown without the root password?
1.I enter: sudo shutdown -h now
It shows:XX is not in the sudoers file
2.So I add XX to /etc/sudoers
then enter:sudo shutdown -h now
It shows:sudo:shutdown:command not found

/*I imagine that when I work in a company , they will not give me the root password , then how can I shut down the operating system? How will the administrator set up?*/
 
Old 04-02-2012, 10:01 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,508

Rep: Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102Reputation: 2102
shutdown is usually in /sbin/, which is not in users' PATH, which is why it said command not found.

Code:
user$ which shutdown
which: no shutdown in (/usr/lib64/mpi/gcc/openmpi/bin:/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib64/jvm/jre
/bin)
user$ su -
Password:
root$ which shutdown
/sbin/shutdown
Try running "sudo /sbin/shutdown -h now" and see what happens
 
1 members found this post helpful.
Old 04-02-2012, 10:33 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
Quote:
Originally Posted by fxbszj View Post
/*I imagine that when I work in a company , they will not give me the root password , then how can I shut down the operating system? How will the administrator set up?*/
If you work in a company then normally only the administrator will shutdown or reboot the system. If he wants to grant you the rights for that he would set up sudo to allow you to use the the shutdown program only. A good guide on sudo can be found here: https://wiki.archlinux.org/index.php/Sudo
 
  


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
GNOME: Gain privileges using current user's password instead of root's password maxkukartsev Fedora 5 02-10-2012 09:46 AM
[SOLVED] No Root Password or Shutdown option - 9.10 bassplayer69 Ubuntu 6 10-31-2009 02:19 PM
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
root password needed for shutdown msound SUSE / openSUSE 6 06-19-2005 10:25 PM

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

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