16.04: lightdm(lockscreen) can't connect to wifi. (1) Insufficient privileges

After upgrading to 16.04 (clean install) from 14.04, (so not really upgrading, but you get the point) I notice that lightdm with unity-greeter can't connect to WiFi with network-manager. I get the following message: Failed to add/activate connection. - (1) Insufficient privileges.

Not really a big deal, but a bit annoying, since it used to work.


Solution 1:

I think the problem is in the permissions= line in the configuration files in /etc/NetworkManager/system-connections/* after the change I describe below, all went to work as before.

I have four computers with Ubuntu 16.04, two have been updated from 15.10 to 16.04 and two were installed from scratch.

On machines that have been updated, you can select an already configured connection (LightDM user can not create, change or remove connections) before you log in. In the updated machine, an available connection is automatically selected and so it is possible to ssh to the machine.

On machines that received the 16:04 version, LightDM user can not select one of the connections previously created displaying the error insufficient privileges.

After checking the logs and the differences in the configuration files between the machines I realized that the files in /etc/NetworkManager/system-connections/* had small differences!

Installed machines from scratch:

[Connection] id=corona uuid=4ce20be5-d5a0-41c5-820c-852136fade99 type=wifi permissions=user:modolo:; secondaries=

Updated machines:

[Connection] id=corona uuid=9bbd3c2b-295b-45e0-b1da-5c6b72e3734d type=wifi permissions= secondaries=

What has changed, in my view, with the new NetworkManager is that even when the connection is created and saved to ALL, permissions are created only for the user who is editing the connection (permissions=user:modolo:;).

After updating the permissions from "line=user:modolo:;" to "permissions=" in all connections files you can select the same before authentication and in addition, if any of the connections is active, it is automatically selected.

I hope this helps and works for everyone.

Hugs, Marcelo Modolo