1

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?

0

1 Answer 1

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
1
  • For me on Ubuntu 18.04 it is nmcli n off
    – SimonH
    Jan 13, 2022 at 9:28

Not the answer you're looking for? Browse other questions tagged .