Wifi Guide

How to Get Wifi Password Linux? Proven Ways To Find Credentials

Introduction If you have ever connected a Linux machine to a wireless network and later forgotten the passphrase, you are not alone. Many users ask how to get wifi password Linux systems have already saved, especially after switching desktops, reinstalling a d

HowToFixWiFi

Introduction

If you have ever connected a Linux machine to a wireless network and later forgotten the passphrase, you are not alone. Many users ask how to get wifi password Linux systems have already saved, especially after switching desktops, reinstalling a distribution, or handing a device to another person. The good news is that Linux usually stores wireless credentials in predictable locations, and several safe methods can reveal them again.

This guide explains proven ways to find saved Wi-Fi credentials on Linux. It covers terminal commands, configuration files, desktop settings, network managers, routers, and password managers. It also explains permissions, security, troubleshooting, and best practices so you can recover your own password without weakening your system.

Before you begin, make sure you are authorized to view the network credentials. These methods are intended for your own computer, your own network, or systems you manage. Accessing another person’s saved passwords without permission may violate privacy laws and workplace policies.

How Wi-Fi Passwords Are Stored on Linux

Linux is flexible, so there is no single universal storage location for Wi-Fi credentials. The exact location depends on the network management tool, desktop environment, distribution, and connection type. Understanding this is the first step in learning how to get wifi password Linux systems have saved.

Most modern distributions use NetworkManager. NetworkManager stores connection profiles, including wireless security settings, in files under /etc/NetworkManager/system-connections/. The password may be stored directly in the profile as a pre-shared key, or it may be referenced through a secret agent such as GNOME Keyring or KWallet.

Older or minimal systems may use wpa_supplicant, which stores networks in a configuration file such as /etc/wpa_supplicant/wpa_supplicant.conf. Lightweight systems may use iwd, which stores passphrases under /var/lib/iwd/. Server installations may use netplan, which can include wireless credentials in YAML files. Enterprise networks using 802.1X may store usernames, certificates, and passwords separately.

NetworkManager Storage Basics

NetworkManager profiles are usually readable only by root. A typical profile contains an [802-11-wireless-security] section with a psk value for WPA2 or WPA3 personal networks. If the profile says psk-flags=1, the secret may be stored in a keyring rather than in the file.

wpa_supplicant Storage Basics

The wpa_supplicant configuration file can contain one or more network blocks. Inside each block, a WPA personal network usually has an ssid and a psk. The psk may be the plain text passphrase or a 64-character hashed value. A hashed psk cannot be reversed into the original password.

iwd Storage Basics

iwd stores known networks in files under /var/lib/iwd/. A file named after the network, such as MyNetwork.psk, can contain a Passphrase= line. Access to these files is restricted, and the exact format may vary by iwd version.

Method 1: Use nmcli to Show the Password

For many users, the fastest way to recover a saved password is to use NetworkManager’s command-line tool, nmcli. This method works well on distributions such as Ubuntu, Fedora, Debian, Linux Mint, and Arch-based systems that use NetworkManager.

First, list saved connections to find the exact profile name:

nmcli connection show

Then show details for the network. Replace YOUR_SSID with the actual connection name:

nmcli connection show "YOUR_SSID"

Look for the line labeled 802-11-wireless-security.psk. If the password is stored in the profile, it appears there. To filter the output, use:

nmcli -s -g 802-11-wireless-security.psk connection show "YOUR_SSID"

If the command returns nothing, the password may be stored in a keyring, the profile may use 802.1X, or you may not have permission to view secrets. In that case, try running the command with sudo:

sudo nmcli -s -g 802-11-wireless-security.psk connection show "YOUR_SSID"

This is one of the most reliable answers to how to get wifi password Linux users can apply without opening configuration files manually.

Finding the Password for the Active Connection

If you are currently connected and do not know the profile name, first identify the active device and connection:

nmcli device status
nmcli connection show --active

Then use the connection name shown in the active list with the previous command. If multiple profiles have similar names, use the exact UUID instead:

nmcli -s -g 802-11-wireless-security.psk connection show uuid YOUR_UUID

Method 2: Read NetworkManager Connection Files

When nmcli does not reveal the secret, you can inspect the profile file directly. This method is useful for troubleshooting and for understanding how NetworkManager stores data.

List the available profiles:

sudo ls -l /etc/NetworkManager/system-connections/

Open the relevant file. File names often include the SSID and a .nmconnection extension:

sudo cat /etc/NetworkManager/system-connections/YOUR_SSID.nmconnection

Search for the security section. A typical WPA personal profile contains lines like:

[802-11-wireless-security]
key-mgmt=wpa-psk
psk=your_wifi_password
psk-flags=0

If psk-flags=1, NetworkManager is asking a secret agent to provide the password. In that case, the password may be in GNOME Keyring, KWallet, or another credential store. If psk-flags=2, the password is not saved and must be entered manually each time.

Be careful not to edit these files casually. A small formatting error can break the connection. If you need to change a password, prefer nmcli or the desktop settings interface.

Method 3: Use GNOME Settings

GNOME provides a graphical way to view saved wireless passwords. This is helpful if you prefer not to use the terminal.

  1. Open Settings.
  2. Select Wi-Fi.
  3. Click the gear icon next to the saved network.
  4. Open the Security tab.
  5. Look for the password field.
  6. Use the reveal icon, often an eye symbol, to show the password.

You may be prompted for your user password or keyring password. GNOME stores secrets through the Secret Service API, often backed by GNOME Keyring. If the keyring is locked, unlock it first before attempting to reveal the password.

On some distributions, the Wi-Fi password can also be viewed through the GNOME connection editor:

nm-connection-editor

Select the wireless connection, open the Wi-Fi Security tab, and reveal the password. This tool is especially useful when the standard Settings app hides advanced options.

Method 4: Use KDE Plasma Network Settings

KDE Plasma stores and displays wireless credentials through its network management interface. If you use Kubuntu, KDE Neon, or another Plasma-based distribution, this method is convenient.

  1. Open System Settings.
  2. Go to Connections or Network.
  3. Select the saved Wi-Fi network.
  4. Open the Wi-Fi Security tab.
  5. Reveal the password using the visibility icon.

KDE may use KWallet to store secrets. If KWallet is locked, Plasma may ask for the wallet password before showing the credential. If KWallet has been reset or the wallet password is unknown, the saved Wi-Fi password may no longer be recoverable from that store.

You can also use nmcli on KDE systems because Plasma commonly uses NetworkManager underneath. Therefore, terminal methods and graphical methods often access the same profile data.

Method 5: Check wpa_supplicant Configuration

Some systems, especially minimal installations, embedded devices, servers, or older setups, use wpa_supplicant directly. In that case, the password may be in a configuration file.

Common locations include:

  • /etc/wpa_supplicant/wpa_supplicant.conf
  • /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
  • /etc/wpa_supplicant.conf

Inspect the file with root privileges:

sudo cat /etc/wpa_supplicant/wpa_supplicant.conf

A simple WPA2 network block may look like this:

network={
    ssid="HomeNetwork"
    psk="your_wifi_password"
}

If the psk is a long hexadecimal string instead of a quoted passphrase, it is a hashed key. You cannot easily convert it back to the original text. However, if you have the original passphrase written somewhere, you can generate the same hash with wpa_passphrase:

wpa_passphrase "HomeNetwork" "your_wifi_password"

This command is also useful when creating a new wpa_supplicant configuration file. It avoids storing the plain text password in some workflows, although the output still contains the passphrase unless you remove that line.

Always protect wpa_supplicant files. They often contain plain text credentials and should have restrictive permissions, typically readable only by root.

Method 6: Find Passwords Stored by iwd

iwd is a modern wireless daemon used by some distributions and minimal environments. It stores network information under /var/lib/iwd/.

List the stored files:

sudo ls -l /var/lib/iwd/

Look for files ending in .psk. The file name usually corresponds to the network name. Display the file:

sudo cat /var/lib/iwd/YOUR_NETWORK.psk

You may see a line such as:

Passphrase=your_wifi_password

Depending on the iwd version, the file may also contain a hashed pre-shared key. If only a hashed value is present, you cannot recover the original plain text password from it. In that situation, use another method such as the router admin panel or a password manager.

iwd may also store 802.1X credentials in separate files. These can contain usernames, passwords, and certificate paths. Because they are sensitive, restrict access and back them up carefully.

Method 7: Inspect netplan Configuration

On Ubuntu Server and some cloud images, networking is configured with netplan. Netplan YAML files can include wireless credentials, especially on systems without a desktop environment.

List netplan files:

sudo ls -l /etc/netplan/

Read the relevant YAML file:

sudo cat /etc/netplan/01-netcfg.yaml

A wireless section may include an access point name and password:

wifis:
  wlan0:
    dhcp4: true
    access-points:
      "HomeNetwork":
        password: "your_wifi_password"

YAML is sensitive to indentation, so do not edit it with tabs or inconsistent spacing. If you change a netplan file, apply it carefully:

sudo netplan apply

Because netplan files may contain plain text passwords, protect them with strict permissions and avoid committing them to version control.

Method 8: Recover the Password from the Router

If Linux does not have the password saved, or if it is stored only as a hash, the router itself may reveal it. This method is useful when you own the network and have router admin access.

First, find your gateway address:

ip route | grep default

Common gateway addresses include 192.168.1.1, 192.168.0.1, and 10.0.0.1. Open the address in a browser, log in with the router admin credentials, and look for sections such as Wireless, Wi-Fi, Security, or WLAN. The current passphrase may be displayed there, sometimes hidden by default.

If the router password is unknown, check the router label, ISP documentation, or a saved password manager. Many ISP-provided routers use a default Wi-Fi password printed on the device. If the password was changed and forgotten, a factory reset may restore defaults, but that will disconnect all devices and reset custom settings.

Method 9: Search Password Managers and Keyrings

Many users save Wi-Fi passwords in password managers, notes, or keyrings. Checking these can be faster than searching system files.

Places to check include:

  • GNOME Keyring through seahorse
  • KWallet through KDE Wallet Manager
  • Bitwarden, 1Password, KeePassXC, or LastPass
  • Browser saved passwords, if the router admin password was saved there
  • Encrypted notes or secure documents
  • Old screenshots or setup documents

To open GNOME Keyring secrets, run:

seahorse

Search for the SSID, router address, or words such as Wi-Fi, wireless, or network. In KWallet, open Wallet Manager and search the relevant wallet. If the wallet is encrypted and the password is unknown, recovery may not be possible.

Password managers are often the safest long-term solution because they separate credentials from system configuration files and make sharing easier across devices.

Comparison of Recovery Methods

The best method depends on your distribution, desktop environment, and how the password was originally saved. The table below compares common approaches.

Method Best For Requires Root Can Show Plain Text Notes
nmcli NetworkManager systems Sometimes Often Fast and scriptable
Connection files Troubleshooting NetworkManager Yes If psk is stored Do not edit blindly
GNOME Settings GNOME desktops No, but keyring unlock may be needed Yes Graphical and user-friendly
KDE Plasma Plasma desktops No, but wallet unlock may be needed Yes Uses KWallet or NetworkManager
wpa_supplicant Minimal or older systems Yes If passphrase is stored May contain hashed psk only
iwd iwd-based systems Yes Sometimes Format varies by version
netplan Servers and cloud images Yes If password is stored YAML indentation matters
Router admin panel Network owners No, but admin login needed Often Can reset network if needed
Password managers Organized users No Yes Best for long-term credential storage

Troubleshooting Common Problems

If you cannot find the password, the issue may be permission-related or configuration-related. Try the following checks.

If nmcli returns no password, verify that the profile actually stores the secret:

nmcli connection show "YOUR_SSID" | grep -i psk

If the profile uses psk-flags=1, unlock your keyring and try again. If it uses psk-flags=2, the password is not saved, and you must obtain it from the router or another source.

If you see permission denied errors, use sudo for system files. However, avoid running graphical apps as root unless necessary. For desktop keyrings, unlock the keyring as your normal user.

If the SSID contains spaces or special characters, quote it in commands:

nmcli connection show "My Home Network"

If multiple profiles exist for the same SSID, inspect each one. NetworkManager can store separate profiles with different settings, such as one for home and one for a hotspot.

If the password appears as a hash, remember that a hashed WPA key cannot be reversed. You can still use the hash to connect, but you cannot recover the original human-readable passphrase from it.

Security, Permissions, and Privacy

Wi-Fi passwords are sensitive. Anyone who obtains them can join your network and potentially access local resources. Treat recovered credentials carefully.

Linux protects many credential files with root-only permissions. Do not change those permissions to make recovery easier. Instead, use sudo when appropriate and keep files restricted.

Enterprise networks are different from home networks. An 802.1X profile may contain a username, password, certificate, and private key. These credentials may grant access to corporate resources, so handle them according to your organization’s security policy.

Avoid copying passwords into shell history if possible. Some commands may store plain text in ~/.bash_history. You can prevent history recording for a command by prefixing it with a space in many shells, or by clearing history afterward:

history -c

Also avoid sharing screenshots that reveal passwords, and do not send credentials over unencrypted channels.

Tips and Best Practices

  • Use nmcli first on modern Linux distributions because it is fast and usually accurate.
  • Keep your keyring or wallet password known and backed up securely.
  • Store Wi-Fi passwords in a reputable password manager.
  • Document router admin credentials separately from Wi-Fi passwords.
  • Use strong, unique Wi-Fi passwords and modern security such as WPA3 where supported.
  • Avoid storing plain text passwords in notes, scripts, or cloud documents.
  • Back up NetworkManager profiles carefully if you migrate to a new machine.
  • Remove old connection profiles for networks you no longer use.
  • When sharing a network, consider a guest network instead of giving out the main password.
  • Test a recovered password before changing it, so you know which credential is currently active.

Frequently Asked Questions

Why does nmcli not show my Wi-Fi password?

This usually happens because the password is stored in a keyring, the profile uses psk-flags=1, the password is not saved, or you lack permission. Unlock the keyring, use sudo, or check the connection file directly.

Can I recover the original password from a hashed psk?

No. A hashed WPA pre-shared key is designed to be one-way. You can use the hash to authenticate, but you cannot reverse it into the original passphrase.

Can I find a Wi-Fi password without root access?

Sometimes. If your desktop environment stores the secret in your user keyring, GNOME Settings or KDE Plasma may reveal it after you unlock the keyring. System files generally require root access.

What about enterprise or school Wi-Fi passwords?

Enterprise networks often use 802.1X. The saved credentials may include a username and password, or certificates. These are stored differently from home WPA2 or WPA3 passwords and may be managed by your organization.

What if I cannot recover the password anywhere?

If no system, keyring, router, or password manager contains it, you may need to reset the router or reconfigure the network. A factory reset restores default credentials printed on the router, but it disconnects all devices.

Does this work on every Linux distribution?

No single method works everywhere. Ubuntu and Fedora commonly use NetworkManager, while minimal systems may use iwd or wpa_supplicant. Choose the method that matches your network stack.

Conclusion

Learning how to get wifi password Linux systems have saved is mostly a matter of identifying the network manager and storage method in use. Start with nmcli on NetworkManager-based distributions, then check connection files, desktop settings, wpa_supplicant, iwd, netplan, routers, and password managers as needed.

Always respect permissions and privacy. Use root access carefully, protect recovered credentials, and store future passwords in a secure password manager. With the methods in this guide, you can confidently recover your own Wi-Fi credentials while keeping your Linux system secure.