Как запретить использовать shutdown обычным пользователям?



1)Как запретить использовать shutdown(reboot,halt) обычным пользователям? Да и вообще как запрещать чтото подобное? 2)В продолжение вопроса о "лишних" учетных записях, а зачем нужен юзер halt???

елки-палки...ты одолел уже.

man shutdown

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


Что интересно, в Слаке это как раз и запрещено по умолчанию. Чтобы включить - приходится просто менять разрешения у соответствующих файлов (у /sbin/halt вроде, но точно не помню).

Вот из переписки на

On Thu, Oct 10, 2002 at 04:14:10PM -0300, Gustavo Soares wrote:

> How can I make all local users to be able to shutdown > on Gnome 1.4?

Well of course anybody can log out of GNOME, so I think you mean shutting down the whole computer system.

I don't think, that GNOME is able to distiguish between local and remote users, so you really shouldn't give this permission to anyone!

But what you can do is to give the permission to a group of users.

First choose a group or define a new one for those, who should be able to shutdown the system. On my system I took the group "wheel".

Add the people you really trust into that group.

Then look where the command "shutdown" is - on my system in /sbin. Change the group for this command, ie. "chgrp wheel /sbin/shutdown". Then change the permissions so, that it is setuid root, but that just the owner and the group is able to call it: "chmod 4750 /sbin/shutdown".

That anybody has it in his PATH, you could make a SymLink: "cd /usr/bin ; ln -s ../../sbin/shutdown"

The same you could do with the command "halt".

P.S.: This has nothing to do with GNOME. ;-)

-- Tschuess Andreas

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.