I want to disable networking from a bash script while not giving it administrative privileges. It's possible from GUI. Is there a way to do it from CLI?
1 Answer
You can use nmcli
to perform such operation:
nmcli nm enable false
nmcli
man pages:
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