Home Interests Raspberry Pi

How to Forget a Saved Wi-Fi Network on Your Raspberry Pi

Learn how to remove a saved wireless network in about a minute.
howchoo   (467)
August 14, 2023
6 minutes

Share

You'll Need 1

What you'll need
Interests
Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.
Posted in these interests:
networking • 8 guides
pi • 92 guides

This short guide will show you how to delete, or “forget,” a saved wireless network from your Raspberry Pi. This is useful for changing networks or troubleshooting connectivity issues.

1 – Access the command line

Access the Raspberry Pi terminal using SSH or by connecting a keyboard, mouse, and monitor to your Pi.

How to Connect to a Raspberry Pi Remotely via SSH
The preferred (and most common) method of connecting to your Pi to run commands.

2 – Modify the existing wpa_supplicant config

Use the following command to access the full list of configured wireless networks:

/etc/wpa_supplicant/wpa_supplicant.conf

You’ll be prompted to enter your Raspberry Pi password—the default Raspberry Pi password is raspberrypi. If you haven’t already, I highly recommend you change your Raspberry Pi’s password after logging in by running the following command:

passwd

3 – Delete a wireless network

To forget a specific Pi wireless network, delete the corresponding network block, surrounded by opening and closing {} curly braces. For example, deleting the following will “forget” the serenity network:

network={
    ssid="serenity"
    psk="shepherdBookHasScaryHair$1"
    key_mgmt=WPA-PSK
}

If you want to forget a network but keep the configuration in place for later, you can uncomment the block instead by adding a # symbol to the beginning of each line. For example, uncommenting the following will “forget” the serenity network while keeping the details in the file for future use:

#network={
#    ssid="serenity"
#    psk="shepherdBookHasScaryHair$1"
#    key_mgmt=WPA-PSK
#}

When you’re done, save and exit by pressing CTRL-X, typing Y, and pressing enter.

A recommendation before deleting

Of course, if you’re connected to your Pi via the network you want to remove, you’ll be disconnected from the Pi as soon as your Pi forgets the network.

Therefore, I recommend adding a new network before deleting the other network—this makes it slightly easier to add your “new” network. If you need to, finding which network your Pi is connected to is easy.

How to Find the Current Raspberry Pi Wi-Fi Network Name (SSID)
Finding your Pi’s current network name is easy.

4 – Connect to a new network

Connecting to a new network is as simple as generating a new wpa_supplicant.conf file or by running the raspi-config utility.

NEXT UP

How to Run a Minecraft Server on the Raspberry Pi

A whole world trapped inside your Pi.
howchoo   (467)
December 7, 2023

There are several ways to go about running a Minecraft server on the Raspberry Pi. In this guide, I’ll cover how to install Nukkit—a cross-platform Minecraft server that’s super easy to set up on the Raspberry Pi. This server should work with PCs, consoles, and tablets running Minecraft 1.14. I’ll be using a Raspberry Pi

Continue Reading

howchoo

 467 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.

Explore