3

I want to control Network manager from the command-line. This worked well enough in Ubuntu 10.04 (with cnetworkmanager, nmcli is another possible choice).

Since the upgrade to Ubuntu 10.10 however, a D-Bus exception is raised when I attempt to activate a connection from within a SSH terminal:

org.freedesktop.NetworkManager.PermissionDenied: Not authorized to control networking.

It may have to do with /etc/dbus-1/system.d/NetworkManager.conf; where else to look for a clue ?

This issue occurs only when I am ssh'd into the machine; in a gnome session I don't get the same issue -- with the same (admin) user account in both cases.

4

By default, DBus only allows root and users sitting at the physical console to control networking settings.

This can be changed by editing DBus policy files, in this case /etc/dbus-1/system.d/NetworkManager.conf

  • Any idea for Fedora boxes? – Jonathon Reinhart Jul 8 '15 at 17:31
  • on my Mint 17.2 system the necessary file is called org.freedesktop.NetworkManager.conf – frankster Aug 11 '16 at 14:32
  • This answer is outdated, sometime I'll update it for the proper way using polkit. Until then, see gist.github.com/grawity/3886114 – grawity Aug 11 '16 at 14:36
0

On more recent Ubuntu's this is control by the polkit.

make new file: /etc/polkit-1/localauthority/50-local.d/allow-ssh-networking.pkla

Add:

[Let adm group modify system settings for network]
Identity=unix-group:adm
Action=org.freedesktop.NetworkManager.network-control
ResultAny=yes

Then restart the polkit service.

You can find a list of valid NetworkManager actions on your system with pkaction | grep NetworkManager

More info: https://forums.fedoraforum.org/showthread.php?276493-Remotely-starting-a-VPN-connection-does-not-work

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.