4

The WiFi-related configurations are stored in /etc/wpa_supplicant/wpa_supplicant.conf file. For example, if WPS (WiFi protected setup) is succeeded by using wpa_cli command, the configuration information, such as SSID, passphrase, etc. will be stored inside it.

Now, what I want to do is to clear all the wifi configuration information inside /etc/wpa_supplicant/wpa_supplicant.conf. And what I am considering now is:

1.delete all the content in /etc/wpa_supplicant/wpa_supplicant.conf file
2.write the original information into it
3.reboot the system

But, is there any other way to reset the configuration file?

6

Unfortunately, there isn't a really convenient way of doing this - that is why I would recommend to always have a backup of a .conf-files original content.

Instead of deleting and re-writing the content of the file, you could just swap it altogether and than restart just the networking service:

sudo cp /etc/wpa_supplicant/wpa_supplicant.backup /etc/wpa_supplicant/wpa_supplicant.conf
sudo service networking restart

This way, you don't have to reboot.

Another way I thought of was reinstalling the wpasupplicant-package (sudp apt-get install --reinstall wpasupplicant). However, this didn't reset an altered wpa_supplicant.conf-file and is therefore not solving the problem.

  • Backup the original configuration file, and copy it to /etc/wpa_supplicant/wpa_supplicant.conf when resetting the WiFi configuration is a good idea. Thank you – bamb00dark Nov 15 '16 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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