The following article is especially dedicated to all those users who use Ubuntu on a laptop. In order to reduce the resource consumption of our team i thus extending the life of our battery as much as possible, In the next tutorial we will show you how turn off Wi-Fi automatically in this operating system.
In addition to being one energy saving measure for our computer, block any type of media we are not going to use it is a basic security step for a system, so it is also recommended as a measure of isolation from any type of external attack.
If you’re a user who doesn’t make general use of your computer’s Wi-Fi connectivity, either because you connect using a network cable or because you don’t need it, it’s a good idea to keep this default device turned off on your system. To turn off connectivity from the moment we simply log on to the computer we will edit as an administrator user the file located in the /etc/rc.local path of our computer.
Once inside, we will go to the end of the file and add the next line, just before the one you put exit 0.
rkfill block wifi
The above sentence applies to any user who uses the computer. Once the file has been modified we will have to restart the computer to check the results. Later, if we want to re-enable the Wi-Fi connectivity of our computer we can do so through the indicator located in the respective area.
In case we want to turn off Wi-Fi connectivity for one or more specific users of the system, but not all, We will have to add a new file within the path ~ / .Config / autostart / with the name of nowifi.desktop. Its content must be as follows:
[Desktop Entry] Type=Application Exec=rfkill block wifi Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name=no-wifi-on-start Comment=No wifi on start
In this case, to be able to check the effectiveness of this script no need to restart the computer. All we have to do is log out of the user we have open and log back in.