How to Recover Your WiFi Password on Linux (Step-by-Step)

If you’re running Linux and you’ve forgotten the password to your own WiFi network, don’t panic. Linux keeps a record of every network you’ve connected to, and the password is stored right there on your system. This guide is for anyone who needs to dig that password out—whether you’re helping a friend, setting up a new device, or just having a brain fart. By the end, you’ll have the password in plain text, no router reset required.


We’ll cover the two most common ways: the terminal method (fast and reliable) and the GUI method (great if you prefer clicking). I’ll also point you to the ultimate wifi password recovery guide for other platforms if you need cross-platform help. Let’s get started.


What You’ll Need


  • A Linux computer (Ubuntu, Fedora, Mint, Debian, etc.) with a saved WiFi network
  • sudo access (you’ll need your admin password)
  • A terminal (Ctrl+Alt+T on most distros)
  • Optional: a file manager if you prefer the GUI method


Step 1: Open a Terminal


Press Ctrl+Alt+T on your keyboard, or search for “Terminal” in your applications menu. This is your command-line home base.


wireless password recovery linux Linux terminal window open on desktop with bash prompt

Step 2: List Saved WiFi Networks


Most modern Linux distros use NetworkManager to handle WiFi connections. The saved network profiles are stored in /etc/NetworkManager/system-connections/. Run this command to see a list of all saved network names (SSIDs):


ls /etc/NetworkManager/system-connections/

terminal command


You’ll see one file per network. The filename is usually the SSID with any spaces replaced by underscores or escaped. For example, MyHomeNetwork or My_Home_Network.


wireless password recovery linux terminal output showing list of network connection files in /etc/NetworkManager/system-connections/

Step 3: View the Password for a Specific Network


Now pick the network you want and display its configuration file. Replace YourNetworkName with the actual filename (you can usually tab-complete). Run:


sudo cat /etc/NetworkManager/system-connections/YourNetworkName

terminal command


You’ll be prompted for your sudo password. Once entered, the file contents will fly by. Look for a line that starts with psk=. The text after the equals sign is your WiFi password—in plain text. If you see a long hex string instead, it might be a PSK hash, but usually it’s the actual passphrase.


If you prefer a one-liner that greps just the password, use: sudo grep psk= /etc/NetworkManager/system-connections/* to show all passwords at once.


wireless password recovery linux terminal output showing psk= line with wifi password in cat output

Step 4: Alternative — Using wpa_supplicant (if you don’t use NetworkManager)


Some Linux setups (especially older ones or lightweight distros) use wpa_supplicant directly. In that case, passwords are often stored in /etc/wpa_supplicant/wpa_supplicant.conf. You can view it with:


sudo cat /etc/wpa_supplicant/wpa_supplicant.conf

terminal command


Look for a psk="YourPassword" line. If the psk value is a hex string, it’s a hash, but the quoted version is the real password.


wireless password recovery linux text file showing wpa_supplicant.conf with psk entry

Step 5: GUI Method (For the Click-Hearted)


If the terminal gives you hives, you can use the built-in network settings app. On GNOME (Ubuntu, Fedora Workstation), open Settings -> Wi-Fi -> click the gear icon next to your connected network -> click the “Security” tab. The password is hidden behind dots, but there’s usually an “eye” icon or a “Show password” checkbox. Other desktop environments have similar options—look in your network connection editor.


wireless password recovery linux GNOME Settings WiFi network security tab showing show password checkbox

Common Pitfalls


  • Permission denied: You forgot the sudo prefix. Without it, you can’t read the files. Always use sudo cat or sudo grep.
  • Network name with spaces: The filename might use underscores or escaped spaces. Use tab-completion in the terminal to get the exact name, or try ls first to see the list.
  • Wrong path: Some distros (like older CentOS) might store connections in /etc/sysconfig/network-scripts/ or use a different manager. If you don’t see anything in the default path, check your distribution’s documentation.


Where to Next


Now that you’ve got the password, you might need it for other devices. Check out our guide on how to recover wifi password without reset for Windows and Mac. If you’re looking for a method that doesn’t require installing any software, our free wifi password recovery with no install page has you covered. And for a broader look, don’t miss the personal wifi password recovery guide. Happy surfing!

Leave a Reply

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