The recurring dialogue prompt “Authentication is required to modify system network connections” in Ubuntu Linux appears when NetworkManager attempts to alter, renew, or scan network profiles without sufficient Polkit (PolicyKit) privileges granted to the active user session. This prompt frequently occurs upon logging in, waking the system from suspend, or connecting via remote desktop environments like XRDP and VNC. Resolving this issue involves creating targeted Polkit authorization rules, verifying user group memberships, and configuring NetworkManager to recognize desktop sessions properly.
Why Ubuntu Prompts for Network Connection Authentication
In Ubuntu, system-level tasks such as configuring network interfaces, setting static IP routes, and initiating Wi-Fi handshakes are managed by the NetworkManager daemon, which runs under root authority. Unprivileged desktop users communicate with NetworkManager over the system D-Bus. To prevent unauthorised background processes from altering sensitive network configurations, Ubuntu routes these requests through Polkit (PolicyKit).
The dialogue triggers under several specific conditions:
- Remote Desktop Sessions: When accessing Ubuntu via XRDP or VNC, the session is categorized as an inactive or non-local seat (
logind). By default, Polkit restricts network alterations on remote seats to administrative users. - Background Wi-Fi Auto-Reconnection: NetworkManager attempts to reconnect to an access point using system-wide connection credentials while the desktop session keyring remains locked.
- Missing User Groups: The active user account lacks membership in the
netdevorsudogroups designated for network management. - Conflicting Polkit Rules: Outdated or missing local authority rules after upgrading between Ubuntu LTS releases (such as moving from Ubuntu 20.04 to 22.04 or 24.04).
| Component | Function in Ubuntu | Trigger Mechanism |
|---|---|---|
| NetworkManager | Controls system network daemons and profiles | Requests modification token via system D-Bus |
| Polkit (PolicyKit) | Evaluates user privilege policies and seats | Denies implicit permission to non-local or unprivileged sessions |
| systemd-logind | Manages active graphical sessions and seats | Marks XRDP/VNC sessions as Active=no or Local=no |
| GNOME Keyring | Stores encrypted WPA-PSK Wi-Fi secrets | Fails to provide stored secret without interactive unlock |
Step 1: Add User to the netdev Group
In Debian and Ubuntu environments, the netdev group is specifically designed to allow members to manage network connections without requiring continuous administrative elevation.
- Open your terminal application by pressing Ctrl + Alt + T.
- Execute the following command to add your user account to the
netdevgroup:
sudo usermod -aG netdev $USER
- Verify that the group assignment succeeded:
groups $USER
You must log out of your graphical session and log back in (or reboot the machine) for the updated group credentials to take effect in the system session.
Step 2: Create a Custom Polkit Rule (Ubuntu 22.04, 24.04 and Later)
Modern Ubuntu installations utilize JavaScript-based Polkit rule definitions located in /etc/polkit-1/rules.d/. Creating a dedicated rule file grants automatic authorisation for network adjustments to members of the sudo and netdev groups.
- In the terminal, create a new rule file using a text editor such as
nano:
sudo nano /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules
- Paste the following configuration into the file:
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &&
(subject.isInGroup("sudo") || subject.isInGroup("netdev"))) {
return polkit.Result.YES;
}
});
- Press Ctrl + O followed by Enter to save the file, then press Ctrl + X to exit the editor.
- Restart the Polkit daemon to compile and apply the new rule:
sudo systemctl restart polkit.service
For similar polkit authorization errors on Ubuntu desktop, refer to our troubleshooting guide on fixing authentication is required to create a color managed device in Ubuntu.
Step 3: Create a .pkla File (Ubuntu 20.04 and Legacy Systems)
If you are operating Ubuntu 20.04 LTS or systems utilizing the older Polkit LocalAuthority format (.pkla), configure the permission file in /etc/polkit-1/localauthority/:
- Open an elevated terminal and run:
sudo nano /etc/polkit-1/localauthority/50-local.d/10-network-manager.pkla
- Enter the following directive block:
[Allow Network Control for Users]
Identity=unix-group:netdev;unix-group:sudo
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
- Save and exit the editor, then restart NetworkManager and Polkit:
sudo systemctl restart NetworkManager polkit
Step 4: Configure Wi-Fi Connections for All Users
If the authentication prompt appears primarily when establishing wireless links, the connection profile may be set to store credentials exclusively within the personal user keyring rather than making the connection available system-wide.
- Open Settings from the Ubuntu application launcher.
- Navigate to the Wi-Fi section.
- Click the Cog icon next to your active Wi-Fi network to open its properties dialogue.
- Under the General tab, tick the checkbox labelled Make available to other users.
- Click Apply. Enter your password once to confirm the system-wide storage of the network profile. Subsequent connections will authenticate automatically in the background.
Step 5: Verify Session Seat Status in systemd-logind
If you encounter this prompt over XRDP or remote desktop connections, check whether your session is recognized as active by systemd:
- Run
loginctl list-sessionsto find your current session ID. - Inspect your session attributes:
loginctl show-session <SESSION_ID> -p Active -p State -p Remote
The custom Polkit rules configured in Step 2 and Step 3 explicitly address non-active and remote sessions (ResultAny=yes), ensuring that remote desktop workflows can modify connection profiles without recurring authentication blocks.