password-img

Bypass pkexec password prompt for admin accounts

So, you want to bypass polkit password prompt in Linux Lite globally. There is a million and some reasons in terms of security why you should think twice before doing this but if you don’t want to be prompted for your admin password at all after login, then this is for you.

Let me stress out that this is not a recommended practice. I’m writing this in direct answer to a Linux Lite user question. Most applications (scripts) in Linux Lite uses pkexec (polkit) for authentication and elevation. Administrative tools which changes system files will always ask you for admin credentials to make any changes for obvious reasons. Lite Tweaks, for example, will ask you for authentication only once when running tasks which requires elevation as long as the application is not quitted. Irrespective, if you still want no polkit password prompt:

In Terminal:

~$ sudo touch /var/lib/polkit-1/localauthority/10-vendor.d/49-linuxlite_nopasswd_global.pkla
~$ gksu leafpad /var/lib/polkit-1/localauthority/10-vendor.d/49-linuxlite_nopasswd_global.pkla

Copy and paste the following text into the leafpad window that pop’d up:

[No pkexec password prompt for sudoers]
Identity=unix-group:sudo
Action=*
ResultActive=yes

The above rule assumes your account is in the sudo group. By default, when installing Linux Lite, your first account is added to the sudo (admin) group.

That’s all there is to it. Launch an application that previously prompted you for your password, e.g.: Install Updates, Synaptic, Lite Updates Notify, you name it… and verify you are not longer prompted for it. If you still get nagged about passwords after making the changes above mentioned, restart your computer and test again.

There are other sensible ways to archive a similar behavior based on applications rules instead of globally, so that admins only allow specific applications to run without password prompts. I may go over some of those options at a later time.

Did you find this post useful?

Buy Ralpy a coffee :)

Cheers all!

Related Post

Linux Mint 17.2 Rafaela on MacBook 4,1 (late 2007)... So you installed Linux Mint in a Macbook 4,1 (or older version) and found out that the iSight webcam does not work. Hmmm... but you want to use your M...
Why you should switch to a different Linux Mint Mi...   Have you experienced slow downloads, connectivity problems and Update Manager errors in Linux Mint when checking for updates? The reason...
Make DuckDuckGo Chrome’s default search engi... So, you want to deploy the search engine that doesn't track you as the default search engine for your users. Here is a quick How-To make DuckDuckGo Ch...

Leave a Reply