How to authorize non-privileged users to use nmcli?

This forum is for discussion about general software issues.

How to authorize non-privileged users to use nmcli?

Postby Idiotist » Thu May 14, 2020 12:50 pm

I'm currently configuring my newly installed archlinux arm on my raspberry pi. I'm an ArchLinux desktop user. However, the arm version of it looks different. On my desktop, if the user is in the group wheel, it is authorized to use commands to control WLAN connections like:
$this->bbcode_second_pass_code('', '$ nmcli device wifi-iframe connect SSID password PASSWORD')
It will succeed without any pop-out without any interruptions on my desktop.
However, on the ArchLinux Arm, I got the following error:
$this->bbcode_second_pass_code('', 'Error: Device 'wlan0' (/org/freedesktop/NetworkManager/Devices/3) disconnecting failed: org.freedesktop.NetworkManager.network-control request failed: not authorized
Error: not all devices disconnected.')
It looks like there is something to do with polkit. However, neither on my desktop nor my raspberry pi have local configurations in /etc/polkit-1/rules.d , and files in /usr/share/polkit-1/actions are identical. Also files in /usr/share/polkit-1/rules.d are not related to NetworkManager at all.
I'm currently stucked on how does org.freedesktop.NetworkManager.network-control works. Any ideas will be helpful except advising me to run nmcli with sudo. I'm not a big fan of using sudo frequently.
Last edited by Idiotist on Thu May 14, 2020 1:34 pm, edited 3 times in total.
Idiotist
 
Posts: 5
Joined: Thu May 14, 2020 12:36 pm

Re: How to authorize non-privileged users to use nmcli?

Postby Idiotist » Thu May 14, 2020 1:30 pm

Update: Thanks for suggestions from people in IRC channels, I tried directly connect a keyboard and a monitor where nmcli device connect/disconnect is allowed for users in group wheel.
That's good news. However, I'm still confused: originally, I was using this command via UART(TTL). There should be no business with network if the logged-in she'll is from UART. I wonder if it's a bug or feature to disable org.freedesktop.NetworkManager.network-control under sessions from TTL :thinking_face:
Idiotist
 
Posts: 5
Joined: Thu May 14, 2020 12:36 pm

Re: How to authorize non-privileged users to use nmcli?

Postby Idiotist » Fri May 15, 2020 4:16 pm

A stack exchange question is posted for this problem: https://raspberrypi.stackexchange.com/q/112462/83579
Idiotist
 
Posts: 5
Joined: Thu May 14, 2020 12:36 pm


Return to General

Who is online

Users browsing this forum: No registered users and 10 guests