PolicyKit settings don't stick

I tried to change PolicyKit rules with KDE Actions Policy gui. After changing the rules, I come back and all my custom settings are gone.

Then I checked the OpenSuse docs for changing explicit PolicyKit rules. They say that I should have /etc/PolicyKit/PolicyKit.conf file already and I should just edit that. But there’s no such file.

This is clean install of 12.2 with hardening settings set to secure (so I really need to set some custom rules).

If you read carefully, you’ll see ‘polkit’ replaced the old ‘policykit’ system, so the relevant directory is now /etc/polkit-1/…



Is the KDE Actions Policy gui supposed to work though?

Is the KDE Actions Policy gui supposed to work though?

Good question. My experience has been that the graphical tool does not work, or at least not with network manager related policies I’ve tried to alter recently. When I get time, I’d like to investigate this further.

One method is to set the policies in /etc/polkit-default-privs.local

For example, suppose you have a policy ‘org.freedesktop.udisks.filesystem-mount’, with the following implicit privileges

  description:       Mount a device
  message:           Authentication is required to mount the device
  vendor:            The udisks Project
  vendor_url:        http://udisks.freedesktop.org/
  icon:              drive-removable-media
  implicit any:      no
  implicit inactive: no
  implicit active:   yes

You might want root authentication to mount removable media. So, you could add a line to /etc/polkit-default-privs.local like this

org.freedesktop.udisks.filesystem-mount no:no:auth_admin

To apply any changes made here, you then run (as root)