LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-2001, 05:25 PM   #1
stephenavallone
LQ Newbie
 
Registered: Oct 2001
Distribution: RedHat 5.2
Posts: 5

Rep: Reputation: 0
shutdown HOW DO I?


Does one have to be logged in as root to use the shutdown command?

If so, how can I obtain a root password as I don't know mine. I boot from a disc.

If not, then what is the proper way to shutdown. As it is I use Alt-Ctrl-Del.

Thanks.
 
Old 10-28-2001, 05:55 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
how do you not know your own root password?? if you've lost it, you need to boot to single mode, and run passwd at the console

to boot to single, at your lilo prompt type
linux single

you can set users to be allowed to shutdown by doing

chmod a+s /sbin/poweroff

or /sbin/shutdown

and obviously to run the program

/sbin/poweroff
 
Old 10-29-2001, 04:10 PM   #3
stephenavallone
LQ Newbie
 
Registered: Oct 2001
Distribution: RedHat 5.2
Posts: 5

Original Poster
Rep: Reputation: 0
Wonderful. I was able to get a root password and shutdown from there. A friend had installed the system years ago and never let me know the password and I didn't know to ask.

The question remains, should I have been able to shutdown as a user? The permissions for /sbin/shutdown are -rwxr-xr-x and as a user I always got a message saying,

bash: shutdown: command not found.

Yet, isn't that what the last 'x' in the permission means, that as any user I can execute that program?

Again, many thanks for your guidance.
 
Old 10-29-2001, 06:50 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
a program may be marked as executable by any user, but important programs such as halt, which poweroff, shutdown and such all back onto i think, will always specifically deal with the user before proceding. inside the code they will say 'YOU ARE NOT ROOT, so I WILL NOT WORK' a higher level of security really.

to get around this, there's the suid bit. setting

chmod a+s /sbin/poweroff

then upon executing that program, the program will take with it the name of the OWNER of the code, not the name of the user who executed it, so it'll be owned by root, so the program will see root.

the command not found is simply cos it won't be on a standard users bath. /sbin should never be on a users path.

no idea what /sbin actually means tho.. anyone...?
 
Old 10-29-2001, 08:49 PM   #5
phek
Member
 
Registered: Jul 2001
Location: California, US
Distribution: Slackware
Posts: 196

Rep: Reputation: 30
if memory servers me correct (from years ago) it stood for either shared bin or secure bin? but then again i figured df stood for disk forensices...
 
Old 10-30-2001, 02:05 PM   #6
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
I thougt sbin stands for system bin
 
Old 11-04-2001, 02:41 AM   #7
lilpenguin0
Newbie
 
Registered: Sep 2001
Location: Hawaii
Distribution: SuSE
Posts: 4

Rep: Reputation: 0
Smile How to shutdown

The shutdown command can be used as a
normal user, or configured such that only
the root user can initiate shutdown. Do
$ info shutdown in a terminal and go to the
very bottom. I found this out when it was
kicking my butt: the time delay is required
when using the shutdown command. You
can do $ shutdown -h now
(now is the time argument).

Hope this helps.
V / R
lilpenguin0
 
  


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
Please help on how to save services shutdown or shutdown from the terminal. wambuzz Linux - General 2 03-11-2005 08:38 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 07:21 PM
unable to 'shutdown' from x... need to shutdown using 'halt' guitarnix Linux - Newbie 5 11-24-2003 02:00 AM
konsole shutdown possible? or key combo = shutdown possible? Laptop2250 Linux - Newbie 3 11-16-2003 11:44 AM
shutdown hang during eth0 shutdown kurtisw Linux - Networking 5 10-30-2003 03:49 PM


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