Non-root user cannot control NetworkManager. polkit rule has no effect

networkmanagerpolkit

I have disabled slim and lightdm, using startx instead. Almost everything works, except I cannot control the network connections with NetworkManager when logged in as the non-root user. Enable Networking and Enable Wifi are grayed out. If I go to Edit Connections and select either connection, the Edit button is grayed out. I have tested using the root user, which does work.

I wrote a polkit rule that is supposed to resolve this, but it does not. I created file /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules containing:

polkit.addRule(function(action, subject) {
  if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("netdev")) {
    return polkit.Result.YES;
  }
});

My userid is a member of group netdev. My system is Debian Sid and my DE is LXDE. My ~/.xinitrc contains:

exec ck-launch-session dbus-launch /usr/bin/startlxde

I have been fighting with this almost all day. Can anyone explain what I am doing incorrectly?

Best Answer

I also had this issue after upgrading to wheezy. After some searching I created a bug report that resulted in the following section in the wheezy release notes:

ConsoleKit in Debian 7.0 does not consider sessions started using startx or display managers lacking consolekit integration (e.g. xdm or slim) as local, which might prevent access to some devices.

We recommend using one of gdm3, kdm or lightdm instead.

So I guess you will have to switch your DM.

Related Question