Step 1
This can be cured by fixing PolicyKit rule for the NetworkManager. First of all check whether .pkla file with [nm-applet] section already exists in /etc/polkit-1/localauthority/10-vendor.d. If yes, make a backup of it and alter ResultAny=no value to yes in [nm-applet] section of this file.
The structure of these policy rule files is described here.
If this file is absent in 10-vendor.d folder, we will create PolicyKit rule manually. Create the file with the name org.freedesktop.NetworkManager.pkla containing the next lines:
[nm-applet]
Identity=unix-user:your_username
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=no
ResultActive=yes
Replace your_username in this file with your real login name. If you wish to add several users, change the Identity entry like this (and replace usernames with the desired ones):
Identity=unix-user:username1;unix-user:username2
If you wish to add even more users, then you should consider adding all of them to netdev group with useradd and change the rule to:
Identity=unix-group:netdev
Now copy this .pkla file to the PolicyKit directory:
sudo cp org.freedesktop.NetworkManager.pkla /etc/polkit-1/localauthority/50-local.d/
Step 2
You should also check whether PolicyKit Authentication Agent is running - this rule won't work without it. If ps -ef | grep kit | grep agent returns nothing, then it isn't running.
Check whether this binary exists. For GNOME this file can be found here:
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
For MATE it is located here (for 32-bit and 64-bit respectively):
/usr/lib/i386-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1
/usr/lib/x86_64-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1
Its location may vary in different DE. If it was not found there, seek for it:
locate agent | grep -v -E '^/var|doc|so|helper' | grep pol
If you found nothing, then PolicyKit Agent isn't installed at all. Search for the package name in APT database with apt-cache search PolicyKit Authentication Agent command and install appropriate package for your DE. For MATE it will be mate-polkit.
It doesn't start automatically for some reason. You can search /etc/xdg/autostart for the PolKit Agent .desktop launcher and analyze why it fails to start. Or you can create your own launcher using "Startup Applications" of your DE and add the Polkit Authentication Agent command to start it properly.
If you are interested, there's an extensive and nice article about PolicyKit privileges.
org.freedesktop.NetworkManager.pklaif I want two of the users to be able to connect to WiFi? Writing into files such as/etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pklafeels hack-ish (e.g. I'm afraid whether it will break with system updates, upgrades and new software versions) but I'll check if this works - and if it indeed is, then it's a solution, I guess...? – Nickolai Leschov Mar 31 '16 at 17:37/etc/polkit-1/localauthority/10-vendor.d(BTW, check this - if it exists, better to use the existing file). This file alters permissions for the NetworkManager only, so it won't break anything related to updates and so on and so forth. There also may be an issue with PolicyKit Authentication Agent autostart. Please check my update to the answer. – whtyger Apr 01 '16 at 09:05ps -ef | grep [p]olkit-gnomeproduces nothing, butps -ef | grep [p]olkitshows/usr/lib/policykit-1/polkitd --no-debug(see this pastebin), so the PolicyKit is running. There are no files in10-vendor.d, nor50-local.d, but the directories themselves are there. When I add said files to the appropriate directories and reboot, message "(32) Insufficient privileges." changes to "(32) Not authorized to control networking." – Nickolai Leschov Apr 03 '16 at 00:13mate-polkitpackage. Here's some info. Check, whether it is installed, install if not, run Agent and check. The mentioned bugreport explains how to fix the issue, if it doesn't run on autostart. BTW, you shouldn't duplicate files, add only one copy into50-local.d. – whtyger Apr 03 '16 at 07:30/usr/lib/mate-polkit/polkit-mate-authentication-agent-1is not present, even thoughmate-polkitis already installed. – Nickolai Leschov Apr 03 '16 at 11:10/etc/xdg/autostart- PolicyKit Agent.desktoplauncher may be there, but doesn't work for some reason - maybe MATE isn't among DE, where it is shown?). I'll update my answer with these details, specific to MATE. – whtyger Apr 03 '16 at 13:29ResultAny=yesis the key to allow my user service application to manipulate NM settings via dbus. – Ben Oct 10 '22 at 01:32