Lubuntu 22.04下非root用户无需sudo执行nmcli添加网络连接的问题咨询
我目前在用Lubuntu 22.04发行版,想让普通用户不用root权限就能执行这条添加网络连接的命令:nmcli c add ifname enp3s0 type ethernet con-name 'connection-test'
但执行后得到了错误提示:
Error: Failed to add 'connection-test' connection: Insufficient privileges
我已经按照相关建议把目标用户加入了netdev组,用的命令是sudo adduser <username> netdev,但问题依然没有解决。之前看到过这样的说明:
On Debian, the "netdev" group gains access to using Network Manager. On Ubuntu, Network Manager access rights are gained by being at the system console, so the name of this entry in gnome-system-tools is misleading.
The "netdev" group can administer wicd and wpasupplicant.
The "netdev" group can set the avahi host name using DBus.
The "netdev" group can administer Bluetooth devices.
这里我有两个疑问:
- 这是不是意味着在Ubuntu系列系统(包括Lubuntu)里,能获取Network Manager操作权限的组不是netdev,而是其他组?
- 有没有办法让非root用户不用sudo就能成功执行
nmcli c add这条命令?
另外还看到有相关内容建议创建一个以root权限运行的服务,通过这个服务来创建NetworkManager连接,这种方案是否可行呢?
备注:内容来源于stack exchange,提问作者User051209

