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

Re: Rechner als normaler Benutzer herunterfahren



On Wed, Jun 22, 2005 at 05:08:52PM +0200, Thilo Engelbracht wrote:
> Am 22.06.2005 um 16:35 Uhr schrieb Wolf Wiegand <wolf@kondancemilch.de>:
> 
> > On Wed, Jun 22, 2005 at 03:12:38PM +0200, Thilo Engelbracht wrote:
> >  
> > > > Die Benutzer sind aber schon auf einer der virtuellen Konsolen angemeldet,
> > > > oder? Also nicht nur über kdm/gdm? Sonst wird das wohl nicht
> > > > funktionieren, da nur genau das ('Ist einer der User in shutdown.allow
> > > > auf einer virtuellen Konsole angemeldet?') von shutdown überprüft wird.
> > > 
> > > ehrlich gesagt weiß ich nicht genau, was eine "virtuelle Konsole"
> > > ist...
> > > 
> > > Auf meinem Server ist _keine_ grafische Oberfläche installiert.
> >  
> > Ah so, ok, dann sollte das in Ordnung sein. Ich habe mir gerade mal den 
> > Source angeguckt. Dort wird als erstes geprüft, ob der aufrufende 
> > Benutzer root ist. Wenn nein, wird sofort abgebrochen und der Parameter
> > -a überhaupt nicht mehr beachtet. Anscheinend klappt das nur, wenn 
> > /sbin/shutdown suid root ist, was es auf meinem Woody hier zumindest 
> > nicht ist (und ich kann micht nicht erinnern, da was dran geändert zu
> > haben).
> 
> Na das ist doch mal eine Aussage! Vielen Dank für die Information.
> 
> Könnte man das denn als Bug bezeichnen? Schließlich verhält sich ja
> der "shutdown"-Befehl nicht so, wie er laut Manpage funktionieren
> sollte.

Ne, es ist genau so, wie beschrieben:

ACCESS CONTROL
       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 shutdown is
       called with the -a argument (add this to the invocation of
       shutdown in /etc/inittab), it checks to see if the file
       /etc/shutdown.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.

Es geht hier klar nur um den Auffruf über Init (und dann wird shutdown
als root aufgerufen) um zu verhindern, das CTRL-ALT-DEL von jeden
'dahergelaufenden User' benutzt werden kann...

Gruss
Grisu
-- 
Michael Bramer  -- http://www.feuerwehr.kreuzau.de/wiki/
PGP: finger grisu@db.debian.org  -- Linux Sysadmin   -- Use Debian Linux
The UNIX Guru's View of Sex: gawk; talk; nice; date; wine; grep;\
touch; unzip; strip; touch; gasp; finger;  gasp; mount; fsck; more;\
yes; gasp; umount; make clean; make mrproper; sleep



Reply to: