17

I'd like Software Center, Update Manager and some other system management applications to work without asking for password (like sudo does if configured with NOPASSWD) but only asking for a confirmation instead, or even without any confirmation. At the same time I wouldn't like to use no user password at all. Is this reachable?

7 Answers 7

20

Ubuntu Software Center authorization uses policy kit. When requested for the authentication during the remove action you can expand the "Details" pointer to see the action that is being invoked. It's org.debian.apt.install-or-remove-packages . You can change the corresponding policy to not request for authentication:

Edit /usr/share/polkit-1/actions/org.debian.apt.policy, search for org.debian.apt.install-or-remove-packages, then find for the defaults section, replace auth_admin and auth_admin_keep with yes .

2
  • this is what i see in org.debian.apt.policy, which things do i need to change to yes? <allow_any>auth_admin</allow_any> <allow_inactive>auth_admin</allow_inactive> <allow_active>auth_admin_keep</allow_active> Oct 5, 2011 at 20:45
  • Replace auth_admin and auth_admin_keep with yes . Oct 6, 2011 at 19:52
3

Adding to joão-pinto's answer, since software center now uses snapcraft's policies, the file to be modified should be this one:

/usr/share/polkit-1/actions/io.snapcraft.snapd.policy

look for the policy with id io.snapcraft.snapd.manage and change all entries under defaults to yes.

You should have this:

  <action id="io.snapcraft.snapd.manage">
    <description gettext-domain="snappy">Install, update, or remove packages</description>
    <message gettext-domain="snappy">Authentication is required to install, update, or remove packages</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

Tested on Ubuntu 20.04.1 LTS

1
  • Providing access to everything was not a wise idea. You got to reconsider this. It may not be suitable for serious people. Update is totally different from new app installation. On this permission anybody can install any app snappy domain. Nov 21, 2020 at 16:42
2

Towards a more generic solution

Since the policies/actions can change from version to version (there are two other answers mentioning two other different files), the best way to handle this is:

  • Install some package for testing
  • Check /var/log/auth.log
  • Identify the file used and the action and make the changes according to this

After installing a package, the entries in /var/log/auth.log were these:

Apr 13 02:06:14 dragon PackageKit: uid 1000 is trying to obtain org.freedesktop.packagekit.package-install auth (only_trusted:1)
Apr 13 02:06:25 dragon polkitd(authority=local): Operator of unix-session:1 successfully authenticated as unix-user:jgr to gain TEMPORARY authorization for action org.freedesktop.packagekit.package-install for system-bus-name::1.79 [/usr/bin/python3 /usr/bin/software-properties-gtk] (owned by unix-user:jgr)
Apr 13 02:06:25 dragon PackageKit: uid 1000 obtained auth for org.freedesktop.packagekit.package-install

I've searched and found the file where the action is:

sudo grep -l -r "org.freedesktop.packagekit.package-install" /usr/share/polkit-1/
/usr/share/polkit-1/actions/org.freedesktop.packagekit.policy

Using this information, on my Ubuntu 20.04.2 LTS, I edit the following file: /usr/share/polkit-1/actions/org.freedesktop.packagekit.policy.

The I've changed the <defaults> on action: <action id="org.freedesktop.packagekit.package-install"> to:

    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
0

Just put in /etc/sudoers all this and it will work

# User privilege specification
root    ALL=(ALL) NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL) NOPASSWD: ALL
-1

These methods with NOPASSWD: ALL seem to result in no password being asked. this is not what I want. I want to be asked the ROOT password.

Seems the right hint was to add "Defaults rootpw" to sudoers. At least Synaptic now starts after receiving the root password. Nice. I can use Ubuntu the Debian way :)

-1

I have been looking for this info for years. I mean like 10 years I've been looking for a way to do this.

But as this is an old thread, I wanted to add a little new info. Or insight if you will. Most of the files in the other answers are no longer the correct file to modify, and new polkits have come into play. I could list the ones I've found to get Software Center and Synaptic to stop harassing me every time I log in. But instead of giving a man a fish, I'd like to teach you how to fish.

The correct answer is already given, but only has 2 votes. And I'd like to add a bit to his answer (and I can't comment yet). If you've gotten here, you're likely getting the GUI popups. All you need is right there. When it asks for the password, there is a "details" dropdown you can click at the bottom. This will tell you EXACTLY what policy is asking for your password. Right-click on it, and copy link. Then go to the terminal and if your not already root type:

su

Enter your root password. You have to do this as SUDO won't work here. Or at least sudo gave me permissions errors. Once you are root issue this command:

grep -l -r "link.you.copied.above.pasted.here" /usr/share/polkit-1/

This will spit out the file you need to edit. Then you just open the file with your favorite text editor as root, such as:

sudo nano /path/to/the/file/grep/spit/out

I find it easier to use a GUI file manager, and a GUI editor started as root. As I can then easily search the file. You can search with nano, but if you're not savvy with nano/vi/emacs it can be a pain. Likely if you're here you're using GUI anyway. If you don't know how you can start a root version of your file manager, you can do so with the following in the terminal (normally). This is an example for mint:

sudo nemo

Or whatever file manager your distro uses. On some older distro's you have to use pksudo or other sudo's, but I've found most recent distro's just sudo works fine. Can depend a little on what desktop you use. If the above doesn't work, you can just use the terminal as I showed above with Nano or your preferred terminal editor.

Then just search the file for the original policy triggering the password prompt. That's the "link" you copied from the popup above, what you used grep to search. Then change all the auth_admin and auth_admin_keep to yes for that policy, and you're golden.

-4

Note:- Disabling password prompts might be a security risk

Open the terminal window from Applications --> accessories --> terminal, run the command:

sudo visudo

Find the line that says

%admin ALL=(ALL) ALL

and change it to

%admin ALL=(ALL) NOPASSWD: ALL

Save and exit the file

5
  • It wont work for software center.
    – karthick87
    Dec 20, 2010 at 8:11
  • That method does remove the authentication/password prompts for many applications, but not for the Software Centre.
    – 8128
    Dec 20, 2010 at 8:25
  • It worked for the update-manager, I figured it would work on the software centre. My bad. I used this method on someone else's computer and not on my own, my bad. Dec 20, 2010 at 8:54
  • Do you just have to disable the keyring to get this to work? Dec 20, 2010 at 9:19
  • Setting "%admin ALL=(ALL) NOPASSWD: ALL" in /etc/sudoers is the first thing I do after I install linux to a PC. But this does not seem to affect GUI applications.
    – Ivan
    Dec 20, 2010 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .