How to prevent a user from disabling the network

Network Manager allows you to configure our networks easily. However, one of its disadvantages is that it allows any user to disable the network. In the case of machines public use this can be a disadvantage , which is important.

Here we will explain how limit access to Network Manager so that only root (or a user who knows the password for root) can disable the network.

Steps to follow

1.- Create the file containing the rule for policy kit

sudo gedit /var/lib/polkit-1/localauthority/50-local.d/networkmanager.pkla

2.- Paste the following content into the file:

[NetworkManager1] Identity = unix-group: users Action = org.freedesktop.NetworkManager.network-control ResultAny = no ResultInactive = no ResultActive = auth_admin_keep [NetworkManager2] Identity = unix-group: users Action = org.freedesktop.NetworkManager.enable- disable-network ResultAny = no ResultInactive = no ResultActive = auth_admin_keep

3.- Add all the users you want to limit to the users group.

sudo adduser username users

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Felipe said

    Wooooow, what good guides 😀

  2.   HO2Gi said

    very good guide.

  3.   gabriel said

    in linux you let me eject from 192.168.1.1 the modem configuration lets add users admins (roots) so that they are not banned