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,258 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
- 61,564
- 18
- 149
- 183
-
For me on Ubuntu 18.04 it is `nmcli n off` – SimonH Jan 13 '22 at 09:28