How to View Saved WiFi Passwords on Linux (Step-by-Step)

Hey there! If you’ve ever forgotten a WiFi password that your Linux machine already knows, you’re in the right place. This guide is for anyone using Linux who wants to view saved WiFi passwords without hassle. By the end, you’ll be able to retrieve any saved network password from your system’s configuration files or via the command line. Whether you’re a beginner or have some terminal experience, these steps are straightforward and tested.


We’ll cover two main methods: using the NetworkManager command-line tool (nmcli) and digging into the system-connections folder. Both are reliable and work on most modern distributions like Ubuntu, Fedora, Debian, and Arch. Let’s get started!


What You’ll Need


  • A Linux machine (any distribution) with a user account that has sudo privileges (or root access).
  • A terminal emulator (GNOME Terminal, Konsole, xterm, etc.).
  • Basic familiarity with typing commands – don’t worry, I’ll walk you through each one.


Step 1: Open a Terminal and List Saved Networks


First, fire up your terminal. To see which WiFi networks your machine has connected to, run this command:


nmcli connection show

Terminal


This will display a table with connection names, UUIDs, types, and devices. Look for the WiFi connections (they should have ‘wifi’ or ‘wireless’ under the TYPE column). Take note of the exact connection name – you’ll need it in the next step.


view saved wifi password linux Linux terminal showing nmcli connection list

Step 2: View the Password for a Specific Network


Now, to view the saved password (PSK) for a particular network, use one of these methods:


Method A – Using nmcli with sudo (recommended):


sudo nmcli -s connection show “YourConnectionName” | grep 802-11-wireless-security.psk

Terminal


Replace “YourConnectionName” with the actual name from Step 1. The -s flag shows secrets (passwords). You’ll be prompted for your sudo password.


Method B – Reading the config file directly:


sudo cat /etc/NetworkManager/system-connections/”YourConnectionName”.nmconnection | grep psk=

Terminal


Both methods will output the password in plain text. Copy it somewhere safe – you might want to backup your WiFi passwords before an upgrade later.


view saved wifi password linux Linux terminal showing saved WiFi password after grep command

Step 3: Alternative – Dump All WiFi Passwords at Once


If you want to view passwords for all saved WiFi networks at once, this one-liner does the trick:


sudo grep psk= /etc/NetworkManager/system-connections/*.nmconnection

Terminal


This will list each network name followed by its password. Note that if the PSK field is missing or shows ‘psk-flags=1’, the password might be stored in a keyring (like GNOME Keyring) instead. In that case, you can use a GUI tool like Seahorse or check the keyring manually.


view saved wifi password linux etc NetworkManager system-connections directory listing

Step 4: For Systems Using wpa_supplicant


Some older Linux installations or minimal setups use wpa_supplicant directly. If NetworkManager isn’t installed, you might find the password in /etc/wpa_supplicant/wpa_supplicant.conf. Open it with:


sudo cat /etc/wpa_supplicant/wpa_supplicant.conf

Terminal


Look for a block with ‘network={‘ and inside it a line starting with ‘psk=’. That’s your password. If you see ‘psk=hash’ instead of plain text, you’ll need to use the nmcli method or a forgotten wifi password recovery command to decode it.


view saved wifi password linux wpa supplicant conf file showing psk line

Common Pitfalls


  • Permission Denied: If you get ‘Permission denied’ when reading config files, you forgot sudo. Prefix all those commands with ‘sudo’ and enter your password.
  • NetworkManager Not Running: If ‘nmcli’ command is not found or returns nothing, check that NetworkManager is active: ‘systemctl status NetworkManager’. If it’s not running, start it with ‘sudo systemctl start NetworkManager’.
  • Password in Hex Format: Some older configurations store the PSK as a 64-character hex string. In that case, the password is actually a hash of the original key. You’ll need to use ‘nmcli’ or a dedicated tool like the best free wifi password recovery software to decode it.


Where to Next


Now you can retrieve any saved WiFi password on your Linux machine. For more advanced techniques, check out our wireless password recovery on Linux guide. If you’re planning to reinstall or upgrade your system, don’t forget to backup your wifi passwords before upgrade – you’ll thank yourself later. And if you’re using other operating systems, our view saved wifi password using terminal article covers Windows and macOS too.

Leave a Reply

Your email address will not be published. Required fields are marked *