无法在 nmcli / polkit 中正确添加 wifi

无法在 nmcli / polkit 中正确添加 wifi

我通过 ssh 远程连接 ubuntu 16.04 系统。

我添加了以下内容/etc/polkit-1/localauthority/90-mandatory.d/99-network.pkla

[Allow netdev users to modify all network states and settings]
Identity=unix-group:netdev
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

我还将我的 ssh 用户添加到 netdev:

user@host:~$ groups
[...] netdev [...]

我重新启动了系统。

当我尝试连接新的 wifi 连接时,出现以下错误

nmcli device wifi connect 'name' password 'psk' ifname 'wlan0' name 'inet'
Error: Failed to add/activate new connection: Insufficient privileges.

所以我认为权限可能设置不正确,但是:

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

我唯一没有的许可是org.freedesktop.NetworkManager.settings.modify.system

是这个原因吗?如果,我怎样才能得到它?

答案1

问题是这/var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla在某种程度上超越了我的规则/etc/polkit-1/localauthority/90-mandatory.d/99-network.pkla

我还不知道为什么,但我会在理解后立即更新这个答案。

相关内容