Forbidden You don't have permission to access / on this server. apache/2.4.6 (red hat enterprise linux) server at nmcheck.gnome.org port 80 [duplicate]

Solution 1:

UPDATE 2022: Please note that - even though this answer was accepted - the internal conf file shouldn't be edited manually according the the comment by thaller. The mentioned solution is: Adding a config file to the /etc/NetworkManager/conf.d directory - Documentation:

you can add additional .conf files to the /etc/NetworkManager/conf.d directory. These will be read in order, with later files overriding earlier ones.

Alternatively using D-Bus: busctl --system set-property org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager ConnectivityCheckEnabled "b" 0

(Haven't tested those options myself)

Original Answer: There is a flag in the file /var/lib/NetworkManager/NetworkManager-intern.conf that is set to false if you disable the setting in the UI:

[connectivity] 
.set.enabled=false

You can use the tool crudini to set the flag using the command line or a script:

sudo crudini --set /var/lib/NetworkManager/NetworkManager-intern.conf "connectivity" ".set.enabled" "false"

For some reason the ui doesn't get updated until a reboot (didn't test logoff/login). Maybe there is some other command line tool that does the change and ensures that the UI gets updated as well.

btw: I used the following command to get the files that changed recently (only checked /var and ~ so far):

sudo find /var -newermt "-1 minute" -ls

There aren't any changes to gsettings. I monitored the settings using this command:

dconf watch /

Solution 2:

I just wanted to add that you can also disable the connectivity checking by simply creating an empty file:

sudo touch /etc/NetworkManager/conf.d/20-connectivity-ubuntu.conf

This file will override any settings found in /usr/lib/NetworkManager/conf.d/20-connectivity-ubuntu.conf.