LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shutdown HOW DO I? (https://www.linuxquestions.org/questions/linux-newbie-8/shutdown-how-do-i-8066/)

stephenavallone 10-28-2001 04:25 PM

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.

acid_kewpie 10-28-2001 04:55 PM

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

stephenavallone 10-29-2001 03:10 PM

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.

acid_kewpie 10-29-2001 05:50 PM

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...?

phek 10-29-2001 07:49 PM

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...

Sylhouette 10-30-2001 01:05 PM

I thougt sbin stands for system bin

lilpenguin0 11-04-2001 01:41 AM

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


All times are GMT -5. The time now is 10:29 AM.