2

I have a test deployment of 16.04 desktop in Hyper-V, as I'm planning a home deployment. I've noticed that when I setup a VPN connection in Network-Manager directly in hyper-v console, I receive no security or password warnings. when I tell it to connect, it just connects.

When I try the exact same steps via XRDP, while logged in via the same user, it asks me for my password several times. Once to unlock the keyring, once when it says "system policy prevents control of network connections.."

enter image description here

Is this a factor or feature of an XRDP or VNC connection that I just have to live with, or is there a way to correct the ubuntu policy such that once I'm logged in as me over XRDP or VNC that it permits these functions without an additional prompt?

PS - i've looked quite extensively on Google etc but none of the advice is relevant to an XRDP session.

Jason-H
  • 21

3 Answers3

2

based on a quick search on internet (see here

You probably need to overwrite existing polkit policies located under /etc/polkit-1/ or under /usr/share/polkit

To override the policies, you would need to create a file containing something like this

 polkit.addRule(function(action, subject) {   
 if (action.id =="org.freedesktop.NetworkManager.settings.modify.system" &&

        subject.isInGroup ("users")) {
        return polkit.Result.YES;    } 
 });

save it under /etc/polkit-1/localauthority.conf.d/03-allow-network-manager (for example, you can use another name if you want to)

and see if this would fix your issue.

PS: I had the same situation but for color managed device and creating this file did the trick

Hope this help Till next time See ya

Griffon
  • 2,778
0

I just found rule "60-network-manager.rules" in /usr/share/polkit-1/rules.d

It seems you can avoid this error if your usr is included in the groups permitted by this policy (sudo, netdev).

(tested in lubuntu 18.4)

0

I had the same problem. Kubuntu 23.10. Same old problem all these years later. So the "action" shown in that image is org.freedesktop.NetworkManager.network-control. So I created a file with the pathname:

/etc/polkit-1/localauthority/50-local.d/20-network-permissions.pkla

containing:

[Network Manager Permissions]
Identity=unix-group:sudo
Action=org.freedesktop.NetworkManager.network-control
ResultAny=yes
ResultActive=yes

(I already had a file there called 10-local-permissions.pkla see this Ask-Ubuntu question here )

That worked for me. No more nagging for my password. I'm in the group "sudo", but if you're in another group like "users", adjust the file content accordingly. Keep the permissions of the containing directories unaltered because polkit is a bit picky about that.

Oh, and the server machine had to be logged out of its own desktop because it seems that it can't run two desktops, but that's another problem.

Dave Rove
  • 301