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?
Asked
Active
Viewed 2,333 times
1 Answers
3
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
Sylvain Pineau
- 63,229