How to disable Wi-Fi automatically in Ubuntu

no Wi-Fi

The following article is especially dedicated to all those users who use Ubuntu on a laptop. In order to reduce the consumption of resources of our team and thus extend the life of our battery as much as possible, in the next tutorial we will show you how disable Wi-Fi automatically in this operating system.

In addition to being a energy saving measure for our team, block any type of media that we are not going to use is a basic safety step for a system, so it is also recommended as a measure of isolation against any type of external attack.

If you are users who do not make general use of the Wi-Fi connectivity of your equipment, either because you connect through a network cable or because you do not need it, it is advisable to keep this means disabled by default within the system. To disable connectivity from the moment we log into the computer simply we will edit as administrator user the file located in the /etc/rc.local path of our team.

Once inside, we will go to the end of the file and add the following line, just before the one that says exit 0.

rkfill block wifi

The previous sentence applies to any user who makes use of the equipment. Once the file is 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 disable Wi-Fi connectivity for one or more specific users of the system, but not all, we must add a new file within the path ~ / .config / autostart / with the name of nowifi.desktop. Its content must be the following:

[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, in order to check the effectiveness of this script no need to restart the computer. It will be enough that we close the user session that we have open and re-enter.


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.   Jimmy olano said

    I think that "" NO va en lo que le vamos a colocar al archivo "rc.local" ni al "nowifi.desktop"

    ¡que se ha colado el código html al blog!
    «fe de errata»
    { ¿o estoy equivocado? ;-) }

  2.   Jimmy olano said

    ha ha ha and comments DO NOT LET HIM DRAIN the html code, this is ironic! 😎

    Here it goes again:
    I think that
    "_"
    It does NOT apply to what we are going to place in the file «rc.local» or the «nowifi.desktop»

    The html code has been leaked to the blog!
    "Errata"
    { or I'm wrong? 😉}

  3.   Jimmy olano said

    To the third time the charm upsssss
    https://twitter.com/ks7000/status/737256440746913796

  4.   Painters Madrid said

    So it goes, haha.

  5.   Luis Gomez said

    Enga that I correct it 🙂