How to disable/enable automatically connecting to WiFi?
Whenever I restart my WiFi router, Ubuntu tries to connect to my neighbours' WiFi networks. There's over 30 wireless networks in the area. Ubuntu prompts me for the password to all of those. This is annoying.
Is there a way to stop Ubuntu trying to automatically connect to WiFi networks?
Solution 1:
I'm updating this answer to reflect new images, since this was done on a laptop.
Click on the wireless icon on the top bar as shown in the image below, and
Then clock on Edit Connections.
Once the window opens, click on the wireless tab, and then click on the Edit button.
Unckeck the connect automatically radio button, and click Save. At this point you need to reboot your system
Once rebooted, you can see from the image below, that the wireless network is not connected. You have to enable it to be able to use it.
Now the wireless network can be enabled/disabled from terminal, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below to list all devices.
rfkill list
To block wireless, you type:
rfkill block <device_number>
To unblock you type:
rfkill unblock <device_number>
as shown in the image below.
Solution 2:
Click on Wi-fi Icon >> Edit Connections >> Then, Click On Wireless Tab, Delete The Wireless Connections That You Don't want to Use or You Want Ubuntu To Stop Automatically Connecting To Them.