I tried the following answer to disable networking, but an error is thrown when I log in.

systemctl disable dhcpcd

rfkill: cannot open /dev/rfkill: Permission denied

I also disabled Bluetooth and Wi-Fi by adding dtoverlay=disable-bt and dtoverlay=disable-wifi to /boot/config.txt.

Would you happen to know how to fix this?

3 Answers 3


Figured it out!

The issue is triggered by /etc/profile.d/wifi-check.sh.

Here is a fix:

sudo sed -i '2i\ \ \ \ \ \ \ \ exit 0' /etc/profile.d/wifi-check.sh
  • Welcome to RPi SE, and congratulations on solving your problem!
    – Seamus
    Commented Mar 4, 2021 at 21:22
  • It works on RPi4 as well!
    – Feriman
    Commented Sep 8, 2022 at 19:40

Try this command rfkill list all

The output should be:

0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: yes
1: acer-wireless: Wireless LAN
    Soft blocked: yes
    Hard blocked: no

And then rfkill unblock all

  • 1
    the answer is a mess... please format the printout as code
    – jsotola
    Commented Sep 12, 2023 at 0:55

Being a Debian package fan, I would build on @sunknudsen's answer, and suggest removing the small package that created the file. I think this is slightly cleaner than editing the file in place to disable it, but both options work fine, so thanks for the pointer to the file causing the error!

Here's how to find out which package deployed the file and remove it:

debian:~ $ dpkg -S /etc/profile.d/wifi-check.sh
raspberrypi-net-mods: /etc/profile.d/wifi-check.sh
debian:~ $ sudo apt purge raspberrypi-net-mods
Purging configuration files for raspberrypi-net-mods (1.3.4) ...
debian:~ $ 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.