I run Debian Wheezy with a simple window manager (Blackbox). If I remember correctly, in Ubuntu some applications like Synaptic and Update Manager ask for sudo password only when/if needed. How do I configure the system so I can launch for instance Update Manager as normal user and only provide sudo password when the system is to be updated?
The window manager is started from ~/.xinitrc
with
exec ck-launch-session dbus-launch blackbox
I have tried adding the file /var/lib/polkit-1/localauthority/50-local.d/test.pkla
with the content below (and restarting X) but it makes no difference; update-manager
still asks for root password when launched.
$ sudo cat /var/lib/polkit-1/localauthority/50-local.d/test.pkla
[test]
Identity=unix-group:sudo
Action=org.debian.apt.update-cache
ResultActive=yes
As requested by Graeme the content of directory /usr/share/polkit-1/actions/
is
com.hp.hplip.policy
com.ubuntu.pkexec.synaptic.policy
com.ubuntu.softwareproperties.policy
org.debian.apt.policy
org.freedesktop.color.policy
org.freedesktop.consolekit.policy
org.freedesktop.policykit.policy
org.freedesktop.udisks.policy
org.opensuse.cupspkhelper.mechanism.policy
Below follows the content of the directory /etc/polkit-1/localauthority.conf.d
:
$ ls /etc/polkit-1/localauthority.conf.d/
50-localauthority.conf 51-debian-sudo.conf
$ cat /etc/polkit-1/localauthority.conf.d/50-localauthority.conf
# Configuration file for the PolicyKit Local Authority.
#
# DO NOT EDIT THIS FILE, it will be overwritten on update.
#
# See the pklocalauthority(8) man page for more information
# about configuring the Local Authority.
#
[Configuration]
AdminIdentities=unix-user:0
$ cat /etc/polkit-1/localauthority.conf.d/51-debian-sudo.conf
[Configuration]
AdminIdentities=unix-group:sudo
Here is the content of the sudoers
file:
$ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
sudo
is the default mechanism for privilege elevation in all Debian based OS's... Debian/Ubuntu/Mint etc. As such your normal user is already a member of thewheel/sudoers
group, so what exactly are you asking? – eyoung100 Dec 30 '14 at 16:14gksudo
but then I need to provide my password even though I don't necessarily want to modify the system (for instance when there are no updates available). I want to be asked for password when I click on the update button. – August Karlstrom Dec 30 '14 at 16:20sudo/kdesudo/gksudo
work. Update Manager/Synaptic and other applications require privilege elevation, therefore the elevation must take place before the application starts not after. Polkit rides on top of sudo, but cannot alter behavior of sudo. See How does sudo work and How is sudo intended to be used – eyoung100 Dec 30 '14 at 16:32aptitude
, if you start it as a normal user you get aBecome root
option. It appears the OP wants the same thing in Update Manager. – Graeme Dec 30 '14 at 16:37ls /usr/share/polkit-1/actions/
? – Graeme Dec 30 '14 at 16:52grep -r update-manager /usr/share/polkit-1/actions
an post the output (if any). – Graeme Dec 30 '14 at 17:14man pkexec
for what I was thinking. – Graeme Dec 30 '14 at 17:51pkexec
is for running the application entirely as another user, which, if the program itself supports Polkit, isn't needed it. For example, that's why GParted and synaptic are run withpkexec
, but configuration of Network Manager, or running Update Manager, don't need it. – muru Dec 30 '14 at 17:55/etc/sudoers
? – eyoung100 Jan 01 '15 at 17:56/etc/sudoers.d/
? – eyoung100 Jan 01 '15 at 18:55README
file in/etc/sudoers.d/
. – August Karlstrom Jan 01 '15 at 20:15