🔍 See Original Answer on Ask Ubuntu 🔗
How to see what pkaction a software uses
February 25, 2017
Edited: April 13, 2017
November 24, 2022
Copy to clipboard: false
Ask Ubuntu has this answer ([How to configure pkexec to not ask for password?]) that is closer to what you need than the link you found earlier.
As a quick example to finding the application, I’ll illustrate using my own script. I wanted to replace
gksu which is being deprecated with
pkexec so I wrote a wrapper script called gsu.
I invoke gsu from the command line with:
Notice the Details drop down arrow. Click it and this is revealed:
[![gsu pkexec details]]
In my example the pkla is controlled by org.gnome.gedit. I’ll use that in the next example, which you would replace with your own:
[![gsu pexec authorities]]
If you want to run without password prompt you would set the following:
<allow_any>yes</allow_any> <allow_inactive>yes</allow_inactive> <allow_active>yes</allow_active>
On a personal note I don’t like repeatedly entering the password myself but will not change
gedit to never ask for password when changing root files using
pkexec. However I would like it to not repeatedly ask for password when running it many times in given session. You can do this with
sudo and you can extend the period from 10 minutes to 120 minutes as I have done on my system. I would like similar functionality for policy kits.