[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: turning off computer



In message <[🔎] Pine.LNX.3.91.970306000313.32714A-100000@speech.braille.uwo.ca>, pa
ul@braille.uwo.ca writes:
  >The easiest way to have a shutdown command that the other members of your 
  >family can use with out giving the root password out is this:
  >Step #1 - create a shutdown user and password ( you don't have to put the 
  >          password in if you don't want to )
  >step #2 - change the field right after the password field (I think it is 
  >          called the group field to 0 which is root access)
  >step #3 - edit the .bash_profile to execute the shutdown command (ie in 
  >	  /sbin/shutdown -h now)

I suggest that you call shutdown directly, rather than through a shell.
If your .bash_profile got deleted or corrupted for any reason, you would
have a root log-in available to everyone.

So in /etc/passwd you would have:

  shutdown:<password>:0:0:Non-superuser shutdown:/root:/root/shutdown

/root/shutdown can be a script that runs shutdown with predetermined
parameters or else prompts for how long to wait, messages to send
to other users and so on.   If this script were to disappear, the log-in
would fail rather than giving a root-access shell.



Oliver Elphick                                      olly@enterprise.net
Isle of Wight                      http://homepages.enterprise.net/olly


Reply to: