How to remove password prompts in linuxmint

It has been asked quite often how to remove the passwords prompts when wanting to run software such as synaptic or the software manager in mint. Whilst it is not recommended to run as root nor run programs that require elevated privalages without a password prompt, it can be annoying and frustrating at the same time. This post will show how to remove these passwords prompts however please note that this is not recommended. In linuxmint two mechanisms are used for the password prompts, sudo (gksu/kdesudo) and policykit. It would prefferrable to use only one of these but as far as I understand, policykit would be the preferred choice however it does nott work will all programs so sudo (gksu/kdesudo) is used where it needs to be.

PolicyKit

0
Gksu
3

To change policy kit
Use alt-f2 , gksu gedit /var/lib/polkit-1/localauthority/50-local.d/disable-passwords.pkla
Change gedit to whichever text editor you use and change gksu for kdesudo in kde.

To remove all password prompts for a specific user
[All]
Identity=unix-user:user
Action=*
ResultActive=yes

To remove all password prompts for a group
[All]
Identity=unix-group:group
Action=*
ResultActive=yes

To remove the password prompt for synaptic only for a specific user
[Synaptic]
Identity=unix-user:username
Action=com.ubuntu.pkexec.synaptic
ResultActive=yes

To remove the password prompt for synaptic only for a group
[Synaptic]
Identity=unix-group:groupname
Action=com.ubuntu.pkexec.synaptic
ResultActive=yes

It is also possible to use
Identity=unix-user:username1, username2 or
Identity=unix-group:group1, group2

If you are not sure what the policy used is, it will be shown in the password dialogue under details.
1

To change sudo(gksu/kdesudo)

The config file for sudo(gksu/kdesudo) is /etc/sudoers, it should only be editing using the visudo command, visudo -f /etc/sudoers

If you want to be able to run all commands using sudo (gksu/kdesudo) without needing a password which is something I do not recommend you do you could add
user    ALL=NOPASSWD: ALL
for a single user or
%group    ALL=NOPASSWD: ALL
for a group

Instead what I would recommend is setting up a command alias for all the programs you wish to run without a passwordan exmple of what this should look like
Cmnd_Alias     NOPASS = /usr/bin/mintinstall, /usr/bin/mintsources

and then have
user   ALL=(ALL:ALL) ALL
user   ALL=NOPASSWD: NOPASS

%group   ALL=(ALL:ALL) ALL
%group   ALL=NOPASSWD: NOPASS

If after doing all this you wish to use sudo (gksu/kdesudo) and not have to worry about policy you can change the .desktop files to reflect this. What I would recommend is to copy /usr/share/applications/synaptic.desktop to ~/.local/share/applications/synaptic.desktop then change
Exec=synaptic-pkexec
to
Exec=/usr/bin/synaptic
The two main reason I recommend this are, you’re not altering a file that needs root permissions, nor will the changes be overwritten the next time the program is updated.

Advertisements
Tagged with: , ,
Posted in 01Ben, Linux Mint, quick info Linux

Please feel free to leave a reply.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 69 other followers

%d bloggers like this: