我想通过 bash 脚本禁用网络,但不授予其管理权限。可以通过 GUI 实现。有没有办法通过 CLI 实现?
答案1
您可以使用nmcli
来执行此类操作:
nmcli nm enable false
nmcli
男人页数:
enable [true|false]
Get networking-enabled status or enable/disable
networking by NetworkManager. All interfaces managed by
NetworkManager are deactivated when networking has been
disabled.
Reference to D-Bus:
interface: org.freedesktop.NetworkManager
method: Enable
arguments: TRUE or FALSE