PolKit и Openbox Oct. 21, 2013, 10:15 a.m.
Tags: { , , , } Category: Software

Сейчас многие программы, требущие повышения привилегий для своей работы, имеют для этого встроенный механизм, реализующий получение необходимых прав при помощи ConsoleKit и PolKit. Это не только удобно, так как не нужно запускать программу от root’а, но и более безопасно.

Однако же, работает такой механизм только в Gnome, KDE и так далее. Что же делать пользователям оконных менеджеров? Необходимо добавить в автозагрузку программу-агент аутентификации. К примеру, в openbox необходимо добавить в файл autostart.sh следующую строчку:

/usr/lib/kde4/libexec/polkit-kde-authentication-agent-1 &

Аналогичная программа есть и для Gnome (polkit-gnome-authentication-agent-1). Поискать уже установленную в системе программу можно при помощи команды

locate authentication-agent | grep lib

English translation:

Now a bunch of software that provides administrative functions uses PolKit and ConsoleKit to rise their privileges. It is also possible to use polkit to execute commands with elevated privileges using the command pkexec followed by the command intended to be executed. This command provides more flexibility and security, in addition to being easier to configure.

This mechanism works pretty nice in Desktop Environments, but what user of window manager should do? Let’s look how to configure openbox. You need to add the following line to autostart.sh:

/usr/lib/kde4/libexec/polkit-kde-authentication-agent-1 &

For Gnome there is a “polkit-gnome-authentication-agent-1” tool available.