[ Date Index ][
Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]
On Friday 19 Sep 2003 2:22 am, Keith wrote:
> Related to this, it would be nice to have a simple way for a "normal"
> user to shut down the local machine, which isn't up to running a
man shutdown
shutdown can be called from init(8) when the magic keys CTRL-ALT-DEL
are pressed, by creating an appropriate entry in /etc/inittab. This
means that everyone who has physical access to the console keyboard can
shut the system down. To prevent this, shutdown can check to see if an
authorized user is logged in on one of the virtual consoles. If shut-
down is called with the -a argument (add this to the invocation of
shutdown in /etc/inittab), it checks to see if the file /etc/shut-
down.allow is present. It then compares the login names in that file
with the list of people that are logged in on a virtual console (from
/var/run/utmp). Only if one of those authorized users or root is logged
in, it will proceed. Otherwise it will write the message
shutdown: no authorized users logged in
to the (physical) system console. The format of /etc/shutdown.allow is
one user name per line. Empty lines and comment lines (prefixed by a #)
are allowed. Currently there is a limit of 32 users in this file.
Note that if /etc/shutdown.allow is not present, the -a argument is
ignored.
So making it SUID might not be enough. Try each.
(It's /sbin/shutdown - halt is just an alias.)
> full-blown desk-top (KDE or Gnome) with this facility built in. From a
> simpler window manager the user must, first open a terminal (or switch
> to a text screen), then su to root (meaning that they could wreak untold
> havoc!), then execute "halt". I could write a script to do this along
> with an "Are you really sure?" warning, but first I need some way of
> getting "halt" to work for a non-root user. It works in Gnome so there
> must be a way. (Sorry to be so stupid, this is one bit of Linux that
> still has me baffled).
>
> Keith (Bailey)
>
>
> --
> The Mailing List for the Devon & Cornwall LUG
> Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
> message body to unsubscribe.
--
Neil Williams
=============
http://www.codehelp.co.uk
http://www.dclug.org.uk
http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
Attachment:
pgp00031.pgp
Description: signature