Error failed to add activate new connection not authorized to control networking

I have Ubuntu 13.04 Gnome with Mate. If I click on the networking icon on the top tool bar and try to do something like add a never before used Wifi or simply click Hardwire Connection 1 when I h...

I have Ubuntu 13.04 Gnome with Mate.

If I click on the networking icon on the top tool bar and try to do something like add a never before used Wifi or simply click Hardwire Connection 1 when I have changed to a new network, I get ‘Connection activation failed. (32) Not authorized to control networking.’

My presumption is that I have lacking some group attribute for my user or else there is some security setting.

I can make the changes if I log in as root instead of myself.

What must be tweaked to allow my user name the privileges to handle this?

asked Jun 4, 2013 at 23:08

Dale Amon's user avatar

To fix this problem, it should be enough to add your user to the network or netdev group. To do it, you can use the GUI in the settings menu (that cog in the top right), or just type something like this in a terminal:

sudo usermod -G netdev -a yourusername

Remember to logout/login again to update your user privileges.

Eliah Kagan's user avatar

Eliah Kagan

115k53 gold badges311 silver badges484 bronze badges

answered Jun 5, 2013 at 0:46

gerlos's user avatar

gerlosgerlos

2,5441 gold badge19 silver badges24 bronze badges

9

In my case, I did not have the privileges. So, either log in as root if using the GUI, or use sudo when using terminal.

answered Feb 6, 2021 at 6:59

Pe Dro's user avatar

Pe DroPe Dro

1472 silver badges10 bronze badges

It has been a while, but I ran into this problem while updating to 14.04. In my case the problem was with the lxdm display manager. Try switching your display managers by running

sudo dpkg-reconfigure lxdm

If you don’t have other manager install try something like GDM:

sudo apt-get install gdm

answered Jul 4, 2014 at 0:30

denten's user avatar

dentendenten

1411 silver badge7 bronze badges

I have Ubuntu 13.04 Gnome with Mate.

If I click on the networking icon on the top tool bar and try to do something like add a never before used Wifi or simply click Hardwire Connection 1 when I have changed to a new network, I get ‘Connection activation failed. (32) Not authorized to control networking.’

My presumption is that I have lacking some group attribute for my user or else there is some security setting.

I can make the changes if I log in as root instead of myself.

What must be tweaked to allow my user name the privileges to handle this?

asked Jun 4, 2013 at 23:08

Dale Amon's user avatar

To fix this problem, it should be enough to add your user to the network or netdev group. To do it, you can use the GUI in the settings menu (that cog in the top right), or just type something like this in a terminal:

sudo usermod -G netdev -a yourusername

Remember to logout/login again to update your user privileges.

Eliah Kagan's user avatar

Eliah Kagan

115k53 gold badges311 silver badges484 bronze badges

answered Jun 5, 2013 at 0:46

gerlos's user avatar

gerlosgerlos

2,5441 gold badge19 silver badges24 bronze badges

9

In my case, I did not have the privileges. So, either log in as root if using the GUI, or use sudo when using terminal.

answered Feb 6, 2021 at 6:59

Pe Dro's user avatar

Pe DroPe Dro

1472 silver badges10 bronze badges

It has been a while, but I ran into this problem while updating to 14.04. In my case the problem was with the lxdm display manager. Try switching your display managers by running

sudo dpkg-reconfigure lxdm

If you don’t have other manager install try something like GDM:

sudo apt-get install gdm

answered Jul 4, 2014 at 0:30

denten's user avatar

dentendenten

1411 silver badge7 bronze badges

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.

asked Dec 6, 2010 at 18:42

epsicot's user avatar

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. (Make sure your user is in the adm group)

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

Steve Clement's user avatar

answered Aug 31, 2018 at 4:59

partofthething's user avatar

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

answered Dec 6, 2010 at 20:28

user1686's user avatar

user1686user1686

401k59 gold badges846 silver badges916 bronze badges

3

Polkit v122 uses javascript for rule files, INI syntax was deprecated. This worked for me:

/* Allow adm group to use nmcli con up/down over ssh */
polkit.addRule(function(action, subject) {
    if (subject.isInGroup("adm") && (
            action.id === "org.freedesktop.NetworkManager.enable-disable-network"
         || action.id === "org.freedesktop.NetworkManager.network-control"
        )
    ) {
        return polkit.Result.YES;
    }
})

— placed as /etc/polkit-1/rules.d/authorize-ssh-nmcli.rules; systemctl restart polkit to apply.

answered Nov 30, 2022 at 13:53

ulidtko's user avatar

ulidtkoulidtko

2,86624 silver badges20 bronze badges

I wrote a combination .sh and .exp scripts that:

  1. activate vpn connection
  2. connect to remote server
  3. download some files from server
  4. deactivate vpn connection

This scripts should run on schedule.
I use nmcli for activate and deactivate connections.
If I run scripts manually it work correctly, but if I run this scripts via cron, I receive message (about vpn conn activation): Error: Connection activation failed: Not authorized to control networking.

In logs I see that the script is run from under me:

Dec  6 18:48:01 maskalev-Aspire-A514-54 CRON[10975]: (maskalev) CMD (./dev/promomed/__DRAFTS__/utils/sftp_monitor/main.sh)

my groups:

maskalev@maskalev-Aspire-A514-54:~$ groups
maskalev root adm cdrom sudo dip plugdev netdev lpadmin lxd sambashare docker

nmcli permissions

maskalev@maskalev-Aspire-A514-54:~$ nmcli general permissions
PERMISSION                                                        VALUE 
org.freedesktop.NetworkManager.checkpoint-rollback                auth  
org.freedesktop.NetworkManager.enable-disable-connectivity-check  yes   
org.freedesktop.NetworkManager.enable-disable-network             yes   
org.freedesktop.NetworkManager.enable-disable-statistics          yes   
org.freedesktop.NetworkManager.enable-disable-wifi                yes   
org.freedesktop.NetworkManager.enable-disable-wimax               yes   
org.freedesktop.NetworkManager.enable-disable-wwan                yes   
org.freedesktop.NetworkManager.network-control                    yes   
org.freedesktop.NetworkManager.reload                             auth  
org.freedesktop.NetworkManager.settings.modify.global-dns         auth  
org.freedesktop.NetworkManager.settings.modify.hostname           auth  
org.freedesktop.NetworkManager.settings.modify.own                yes   
org.freedesktop.NetworkManager.settings.modify.system             yes   
org.freedesktop.NetworkManager.sleep-wake                         no    
org.freedesktop.NetworkManager.wifi.scan                          yes   
org.freedesktop.NetworkManager.wifi.share.open                    yes   
org.freedesktop.NetworkManager.wifi.share.protected               yes

I think I’m interested enable-disable-network, amn’t?

Have you any ideas?

May be I can solve this problem (mainly activate vpn) by other way?

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Official Flavours Support
  • Networking & Wireless
  • [ubuntu] nmcli can’t connect network, user not authorized

  1. nmcli can’t connect network, user not authorized

    Hi all, I’m trying to create a script in order to download the photos from my action camera, on my notebook I didn’t have any problem, but with my server my user don’t have enough permissions.

    nmcli device wifi connect SJ5000 password secret
    Error: Failed to add/activate new connection: Not authorized to control networking.

    The privileges with nmcli for my user.

    Code:

    nmcli general permissions
    PERMISSION                                                 VALUE
    org.freedesktop.NetworkManager.enable-disable-network      no
    org.freedesktop.NetworkManager.enable-disable-wifi         yes
    org.freedesktop.NetworkManager.enable-disable-wwan         no
    org.freedesktop.NetworkManager.enable-disable-wimax        no
    org.freedesktop.NetworkManager.sleep-wake                  no
    org.freedesktop.NetworkManager.network-control             auth
    org.freedesktop.NetworkManager.wifi.share.protected        no
    org.freedesktop.NetworkManager.wifi.share.open             no
    org.freedesktop.NetworkManager.settings.modify.system      no
    org.freedesktop.NetworkManager.settings.modify.own         auth
    org.freedesktop.NetworkManager.settings.modify.hostname    auth
    org.freedesktop.NetworkManager.settings.modify.global-dns  unknown
    org.freedesktop.NetworkManager.reload                      auth

    I tried to get control creating a pkla file (/etc/polkit-1/localauthority/50-local.d/52-network-control.pkla)

    Code:

    cat /etc/polkit-1/localauthority/50-local.d/52-network-control.pkla
    [Enable Controlling of Network Connections]
    Identity=unix-group:adm
    Action=org.freedesktop.NetworkManager.network-control
    ResultActive=yes
    ResultInactive=no
    ResultsAny=no

    I’m in the adm group.

    Can someone help me to solve this problem. I was reading a few days but I didn’t find the answer.

    I’m using Ubuntu 16.04.2 LTS (server)

    Thanks

    Last edited by wildmanne39; March 19th, 2017 at 03:53 AM.


  2. Re: nmcli can’t connect network, user not authorized

    Please use code tags — if you are using New Reply button — highlight text and use the # button in the text box header.

    If using Quick Reply then [code] at the beginning and [/code] at the end.

    Please use the default font color and properties unless you need to highlight or draw attention to a part of your post, but they are not intended to be used for an entire post.


Bookmarks

Bookmarks


Posting Permissions

View previous topic :: View next topic  
Author Message
Phoen7x
n00b
n00b

Joined: 29 Dec 2018
Posts: 16

PostPosted: Thu Jan 24, 2019 8:43 pm    Post subject: [SOLVED] Not authorized to control networking. Reply with quote

Hello everybody,

I have the problem that I am not allowed to add networks despite the activated elogind.

My DE is XFCE4 with lightdm and the gtk-greeter. I use NetworkManager, nm-applet and the nm-connection-edtior. The last two are my problem.

If I want to add a wlan via nm-connection-editor, then this is not possible and will be answered with the following error message:

Code:
Insufficient privileges.



If I want to disconnect my wire I get:

Code:
(1) org.freedesktop.NetworkManager.network-control request failed: not autorized



If I open nm-connection-editor as root, I’m able to add a connection but I could not connect…

I’m desperate because I’ve tried everything and nothing works. I#ve wondered that restart and poweroff works, so I think polkit-elogind works?

My running services:

Code:
 

Runlevel: default

 dbus                                                              [  started  ]

 elogind                                                           [  started  ]

 iptables                                                          [  started  ]

 syslog-ng                                                         [  started  ]

 wpa_supplicant                                                    [  stopped  ]

 NetworkManager                                                    [  started  ]

 acpid                                                             [  started  ]

 avahi-daemon                                                      [  started  ]

 netmount                                                          [  started  ]

 xdm                                                               [  started  ]

 alsasound                                                         [  started  ]

 ntp-client                                                        [  stopped  ]

 cronie                                                            [  started  ]

 cupsd                                                             [  started  ]

 local                                                             [  started  ]

 agetty.tty2                                           [  started 00:28:45 (0) ]

 agetty.tty3                                           [  started 00:28:45 (0) ]

 agetty.tty5                                           [  started 00:28:44 (0) ]

 agetty.tty1                                           [  started 00:28:45 (0) ]

 agetty.tty4                                           [  started 00:28:45 (0) ]

 agetty.tty6                                           [  started 00:28:44 (0) ]

Runlevel: nonetwork

 local                                                             [  started  ]

Runlevel: shutdown

 killprocs                                                         [  stopped  ]

 savecache                                                         [  stopped  ]

 mount-ro                                                          [  stopped  ]

Runlevel: sysinit

 sysfs                                                             [  started  ]

 devfs                                                             [  started  ]

 udev                                                              [  started  ]

 dmesg                                                             [  started  ]

 kmod-static-nodes                                                 [  started  ]

 udev-trigger                                                      [  started  ]

 cgroups                                                           [  started  ]

Runlevel: boot

 modules                                                           [  started  ]

 hwclock                                                           [  started  ]

 procfs                                                            [  started  ]

 binfmt                                                            [  started  ]

 dmcrypt                                                           [  started  ]

 lvm                                                               [  started  ]

 fsck                                                              [  started  ]

 root                                                              [  started  ]

 mtab                                                              [  started  ]

 swap                                                              [  started  ]

 localmount                                                        [  started  ]

 sysctl                                                            [  started  ]

 bootmisc                                                          [  started  ]

 termencoding                                                      [  started  ]

 hostname                                                          [  started  ]

 haveged                                                           [  started  ]

 urandom                                                           [  started  ]

 loopback                                                          [  started  ]

 opensysusers                                                      [  started  ]

 keymaps                                                           [  started  ]

 net.lo                                                            [  started  ]

Dynamic Runlevel: hotplugged

Dynamic Runlevel: needed/wanted

 lvmetad                                                           [  started  ]

 xdm-setup                                                         [  started  ]

Dynamic Runlevel: manual

my groups:

Code:
gid=985(users) Gruppen=985(users),3(sys),986(video),988(storage),990(optical),994(disk),995(audio),998(wheel)

What info [/code]do you need more?

Last edited by Phoen7x on Fri Jan 25, 2019 10:48 pm; edited 1 time in total

Back to top

View user's profile Send private message

Tony0945
Watchman
Watchman

Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Thu Jan 24, 2019 9:32 pm    Post subject: Reply with quote

Try «sudo» before your commands. It sounds like you need root priviledge or are not part of a required group.

Run «ls -l `which <cammand name>`» on the commands that fail on privilege to get the group name.

Back to top

View user's profile Send private message

Phoen7x
n00b
n00b

Joined: 29 Dec 2018
Posts: 16

PostPosted: Thu Jan 24, 2019 11:12 pm    Post subject: Reply with quote

Tony0945 wrote:
Try «sudo» before your commands. It sounds like you need root priviledge or are not part of a required group.

Run «ls -l `which <cammand name>`» on the commands that fail on privilege to get the group name.

Thank you for your answer. If i open nm-connection-editor as root, i’m able to save the wifi, but i’m not able to connector to it. I’ve testet to add me to network group an do ]this workaround but the problem is still present.

Code:

$ ls -l `which nm-applet`

-rwxr-xr-x 1 root root 335408 27. Okt 18:52 /usr/bin/nm-applet

$ ls -l `which nm-connection-editor`

-rwxr-xr-x 1 root root 858760 27. Okt 18:52 /usr/bin/nm-connection-editor

Back to top

View user's profile Send private message

Tony0945
Watchman
Watchman

Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Jan 25, 2019 12:26 am    Post subject: Reply with quote

You need someone with more group knowledge than I and experienced with network manager, which I am not.

These are the groups I belong to, including many that probably don’t exist on your machine.

Code:
tony@MSI ~ $ grep tony /etc/group

tty:x:5:mythtv,tony,jacob,maggi

lp:x:7:lp,tony,root,jacob,cindy,maggi

wheel:x:10:root,tony,developer,maggi,palemoon

audio:x:18:jacob,cindy,tony,mythtv,vdr,kodi,developer,maggi,palemoon

cdrom:x:19:jacob,cindy,tony,vdr,kodi,maggi

tape:x:26:root,jacob,cindy,tony,maggi

video:x:27:root,jacob,cindy,tony,mythtv,vdr,kodi,maggi

cdrw:x:80:root,jacob,cindy,tony,kodi,maggi

usb:x:85:root,jacob,cindy,tony,kodi,maggi

users:x:100:jacob,cindy,tony,kodi,developer,maggi,palemoon

portage:x:250:portage,tony

tony:x:1002:

locate:x:120:tony,maggi

lpadmin:x:106:tony,maggi

plugdev:x:999:tony,maggi

wireshark:x:996:tony,maggi

cron:x:16:tony,maggi

git:x:1004:tony

vboxusers:x:993:tony

vboxguest:x:992:tony

Back to top

View user's profile Send private message

Tony0945
Watchman
Watchman

Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Jan 25, 2019 1:30 am    Post subject: Reply with quote

I use OpenRc and netifrc. You need to be root to run the scripts.

Someone with network manager experience please jump in.
Back to top

View user's profile Send private message

Tony0945
Watchman
Watchman

Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Jan 25, 2019 1:38 am    Post subject: Reply with quote

From the wiki

Quote:
If nm-applet fails to create new networks with the error «Insufficient Privileges,» then it could be a policy kit issue. Create the following file:

Check out the link.

Sorry, don’t use policy kit or any other *kit either.

Back to top

View user's profile Send private message

Phoen7x
n00b
n00b

Joined: 29 Dec 2018
Posts: 16

PostPosted: Fri Jan 25, 2019 11:12 am    Post subject: Reply with quote

Thanks for the many answers.

Oh sorry, I’m running OpenRC and have also installed netifrc

This wiki, I’ve testet but it doesn’t helped me.

Back to top

View user's profile Send private message

Phoen7x
n00b
n00b

Joined: 29 Dec 2018
Posts: 16

PostPosted: Fri Jan 25, 2019 5:55 pm    Post subject: Reply with quote

Seems to be solved by changing plugdev to networkmanager in the workaround.

Could be closed.

Thanks. :)
Back to top

View user's profile Send private message

Tony0945
Watchman
Watchman

Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Jan 25, 2019 6:53 pm    Post subject: Reply with quote

Glad it’s working. Welcome to Gentoo!

Edit your first post please, and add [SOLVED] to it. Some people put it in the front, some in the back. I’m not sure if any position is preferred.

«Add» has always meant «insert after everything else» to me, be I can see how it could mean «insert it anywhere».

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19787

PostPosted: Sat Jan 26, 2019 1:40 am    Post subject: Reply with quote

Personally, I like when the marker is at the beginning of the subject, so that I can tell when scanning down the index which threads are solved or not without needing to follow the subject line to its end.
Back to top

View user's profile Send private message

Tony0945
Watchman
Watchman

Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sat Jan 26, 2019 2:02 am    Post subject: Reply with quote

Makes sense, Hu. IMHO the instructions should say «prepend [SOLVED]» rathen than «add …» which to me implies append.

A poll would be interesting.
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error code 0x992566
  • Error 80 canon 5d mark iii
  • Error failed building wheel for psutil
  • Error captcha failed
  • Error failed building wheel for frozenlist

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии