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. |
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 |
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. |
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...? |
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...
|
I thougt sbin stands for system bin
|
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. |