> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Change Raspberry Pi Wi-Fi Details From the SD Card
- URL: https://itsfoss.com/change-raspberry-pi-wi-fi-from-sd-card/
- Published: 2026-09-02T09:08:54.000Z
- Updated: 2026-09-02T09:38:30.000Z
- Description: No need to connect the Raspberry Pi to a display and keyboard. Take out the SD card and modify the WiFi credentials directly.
- Author: Abhishek Prakash
- Tags: Raspberry Pi

If your Raspberry Pi can no longer connect to Wi-Fi because the SSID or password changed, you can update the Wi-Fi configuration directly from its SD card. This helps when you cannot connect the device to a monitor and keyboard.

That's what I did. I had switched to a different internet provider, and that changed the router, its SSID and the password. I was using a Raspberry Pi Pico W in [my Pi Dog](https://itsfoss.com/raspberry-pi-dog-review/). Connecting it to a screen and keyboard would have been a pain.

The easier option was to just take out the SD card and edit the WiFi details directly there. The entire process is composed of the following step:

- Insert the SD card with Raspberry Pi OS on it on your (Linux) computer
- Go to the mounted rootfs partition and go to /etc/NetworkManager/system-connections/ location
- Here, either create or edit `.nmconnection` file and enter the wifi name (SSID) and password

Let me show that in detail for you.

🚧

Older Raspberry Pi OS releases may use `wpa_supplicant.conf` instead of NetworkManager. In that case, this method may not entirely be applicable. I have tested it on Raspberry Pi 5 running Raspberry Pi OS based on Debian Trixie.

## Step 1: Connect the SD card to your computer

Shut down the Raspberry Pi, remove the microSD card, and insert it into your Linux laptop or desktop using an SD card reader.

Raspberry Pi OS usually has two partitions:

```text
bootfs
rootfs

```

The Wi-Fi configuration is stored inside the `rootfs` partition.

![Mounted rootf and bootfs partitions](https://itsfoss.com/content/images/2026/09/raspberry-pi-wifi-change-sd-1-1.png)

## Step 2\. Find the SD card mount points

Open a terminal and run:

```bash
lsblk -f

```

You should see something similar to:

```text
sda
├─sda1   vfat     FAT32 bootfs B2F0-82D2                             438.1M    13% /run/media/abhishek/bootfs
└─sda2   ext4     1.0   rootfs 15f4c6be-1102-4331-9904-f78e78afd1fd   21.9G    18% /run/media/abhishek/rootfs

```

If you only see bootfs, mounted, you can mount rootfs from the file explorer.

![](https://itsfoss.com/content/images/2026/09/raspberry-pi-wifi-change-sd-3-1.png)

As you can see, for me, the Raspberry Pi root filesystem is available at:

```bash
/run/media/abhishek/rootfs
```

You can also confirm it with:

```bash
mount | grep rootfs
/dev/sda2 on /run/media/abhishek/rootfs type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2

```

## Step 3\. Check the existing Wi-Fi configuration

Recent Raspberry Pi OS releases store NetworkManager connection profiles here:

```text
/etc/NetworkManager/system-connections/

```

🚧

Make sure to use your own username and the correct path of rootfs and files by replacing them in the command examples. You can also keep on using $USER as this environment variable automatically uses your username.

Since we are accessing Raspberry Pi OS through its SD card, run:

```bash
sudo ls -la /run/media/$USER/rootfs/etc/NetworkManager/system-connections/

```

If you already see a `.nmconnection` file, you can edit that file. 

![Network manager connection file in rootfs of Raspberry PI SD card](https://itsfoss.com/content/images/2026/09/raspberry-pi-wifi-change-sd-4-1.png)

### No nmconnection file? Create one

If the directory is empty, create a new Wi-Fi profile.

```
touch /run/media/$USER/rootfs/etc/NetworkManager/system-connections/home-wifi.nmconnection
```

And then use a [terminal-based text editor like Nano](https://itsfoss.com/nano-like-editors/) or even Micro and add the following details:

🚧

In the text below, change the value of `ssid` and `psk` with your wifi access point name and its password.

```
[connection]
id=home-wifi
type=wifi
interface-name=wlan0
autoconnect=true

[wifi]
mode=infrastructure
ssid=YOUR-WIFI-SSID

[wifi-security]
key-mgmt=wpa-psk
psk=YOUR-WIFI-PASSWORD

[ipv4]
method=auto

[ipv6]
method=auto
EOF
```

## Step 4\. Set the correct file permissions

Your work is almost done. You just need to set the correct file permissions. That's because NetworkManager expects connection files to be readable only by root.

To give it the [correct file permissions](https://linuxhandbook.com/linux-file-permissions/?ref=itsfoss.com), use the following command:

```bash
sudo chmod 600 /run/media/$USER/rootfs/etc/NetworkManager/system-connections/home-wifi.nmconnection

```

Verify the permissions:

```bash
sudo ls -l /run/media/$USER/rootfs/etc/NetworkManager/system-connections/

```

The file should look something like:

```text
-rw------- 1 root root ... home-wifi.nmconnection

```

![Verify that the system connections file has correct file permission](https://itsfoss.com/content/images/2026/09/raspberry-pi-wifi-change-sd-5.png)

📋

Before going further, double ensure that you have used the correct WiFi SSID and the password. Any typo and you will have to repeat the process. You won't want that to happen.

## Step 5\. Flush the changes to the SD card before removing

This is an important step. After making all the changes, run this command:

```bash
sync

```

The `sync` command makes sure any pending writes cached in memory are actually written to the SD card.

And then you can either unmount from the file explorer or [use the umount command](https://linuxhandbook.com/umount-command/?ref=itsfoss.com) for both partitions:

```bash
sudo umount /run/media/$USER/rootfs
sudo umount /run/media/$USER/bootfs

```

You can now safely remove the SD card.

## Step 6\. Verifying the connection

Insert the card back into the Raspberry Pi and power it on. After it boots, [check the devices connected on your network](https://itsfoss.com/how-to-find-what-devices-are-connected-to-network-in-ubuntu/) to find the Raspberry Pi's IP address. 

The simplest way would be to log in to your router and see the connected devices.

Otherwise, [Angry IP Scanner](https://angryip.org/download/?ref=itsfoss.com#linux) is a good graphical tool for scanning your network. Command line tool nmap also does the job:

```bash
sudo nmap -sn 192.168.0.0/24

```

Normally, it should show your Raspberry Pi's hostname. You can also try to run scan before turning on Pi and a few minutes after turning it on. This should show the new devices that turn up between the two scans.

Finally, check the connectivity with:

```bash
ping RASPBERRY_PI_IP

```

Or, if [SSH is enabled on your Raspberry Pi](https://itsfoss.com/ssh-into-raspberry/), connect to it:

```bash
ssh username@RASPBERRY_PI_IP

```

By the way, if you have [forgotten the user password of your Raspberry Pi](https://itsfoss.com/reset-raspberry-pi-password/), that can be easily reset too. 

![](https://itsfoss.com/content/images/2024/06/pironman-5.webp) 

#### Pironman 5 Case With Tower Cooler and Fan

This dope Raspberry Pi 5 case has a tower cooler and dual RGB fans to keep the device cool. It also extends your Pi 5 with M.2 SSD slot and 2 standard HDMI ports. 

[Explore Pironman 5](https://www.sunfounder.com/products/pironman-5-nvme-m-2-ssd-pcie-mini-pc-case-for-raspberry-pi-5?ref=itsfoss) 

Enjoy your Raspberry Pi 😄