Re: KDE not allowing shutdown/reboot

From: Thomas Otto (my21stnewsgroupdevnull_at_gmx.net)
Date: 01/11/04


Date: Sun, 11 Jan 2004 11:21:05 +0100


>>Normally, only root can shutdown, halt or reboot a system, but KDE's
>>default display manager is granting this priviledge to a non-root user.
>>The other managers or the terminal are not, which is the default.
>>Remember, Linux is really a multi-user, server OS, so users shouldn't
>>be able to shut it down.
>>
>>You can, as root, grant this priviledge to any user or user group. Just
>>grant user access to execute the shutdown command. 'man chmod' for
>>info.

Actually this doesn't work, but maybe you mean sudo or something
similar, see below.

> In my version, shutdown, reboot etc or controlled using PAM.
> According to /etc/pam.d/..., user access is granted to reboot and
> shutdown. I can verify this from the fact that I am able to reboot
> the system from my X console.
>
> So the permissions are already there. I donot know why KDE refuses to
> see them.

KDE contacts kdm (which is running with root privileges) to shutdown the
PC via the socket "/var/run/xdmctl/xdmctl-:0" whos ownership is changed
to the current user logged in. Basically KDE does
echo -e "shutdown\thalt\ttrynow" > /var/run/xdmctl/xdmctl-:0
and then quits X/kdm.

To be able to shutdown the system as a normal user use visudo to add the
following line to the /etc/sudoers file, then you will be able to
shutdown the PC with 'sudo /sbin/shutdown -h now':

yourlogin machinename= NOPASSWD: /sbin/shutdown -h now

   -Thomas



Relevant Pages

  • Re: KDE not allowing shutdown/reboot
    ... >> In my version, shutdown, reboot etc or controlled using PAM. ... I donot know why KDE refuses to ... I will now try to emulate kdm by creating the socket and writing a ...
    (comp.os.linux.x)
  • Re: Reasons for rights policies, political or technical ? Was : Re: pm-hibernate as user
    ... which I can do as root but not as ... with network, and maybe on other things I did not experiment (to add ... But, in my humble opinion, linux should not be reserved for enterprises, ... shutdown a computer with a command made by basic user. ...
    (Debian-User)
  • Re: [SLE] Problem ending session -- additional info
    ... > screen and see if you can shutdown from there. ... Log back in to KDE, open a shell, su to root and again issue ...
    (SuSE)
  • Reasons for rights policies, political or technical =?UTF-8?Q?=3F=20Was=20=3A=20Re=3A=20pm-h
    ... So I was guessing that invoking pm-hibernate/suspend was involved, which I can do as root but not as user. ... but I wonder why there is no other solution than using dbus to let a user shutdown/hibernate/suspend his computer? ... This is not the only point where the problem apply: you have same troubles with network, and maybe on other things I did not experiment. ... Even windows is able to shutdown a computer with a command made by basic user. ...
    (Debian-User)
  • [SLE] ATI X700: Screen goes blank on runlevel 3
    ... I have an ATI X700 display adapter in my system running SUSE 10.1 i386 ... if I try to enter runlevel 3 after logging into KDE, ... symptom is exhibited if I reboot / shutdown from KDE: ...
    (SuSE)