How to Find Saved Wi-Fi Passwords in Linux

How to Find Saved Wi-Fi Passwords in Linux

You know how frustrating it can be if you’ve ever needed to access a Wi-Fi network but can’t remember the password. Thankfully, if you’re using a Linux computer, there are several ways to view a saved Wi-Fi password.

This tutorial shows you three easy ways to find a saved Wi-Fi password in Linux.

Note: if your Wi-Fi is not working in Linux, we have the fixes here!

Showing Saved Wi-Fi Password Using the Linux Terminal

  1. Open the terminal. You can achieve this by using the CTRL + ALT + T shortcut or your launcher menu.
  1. Navigate to “/etc/NetworkManager/system-connections/”:
cd /etc/NetworkManager/system-connections
System Connections Directory
  1. View the files contained in the directory by running the ls command.
ls -l
Contents Of System Connections Directory

For more tips on using the ls command, check out the most important ls commands you need to know.

Files in this directory contain information on all the wireless networks that your computer has used. Locate the file with the name of the wireless network from which you wish to extract the password.

  1. Using any text editor, open the file with the name of the Wi-Fi from which you wish to know the password.
sudo cat MTE-Test-Wifi.nmconnection
Editing Wifi Configurations

Under the Wi-Fi security section, the Wi-Fi password should be displayed as psk=”password.”

Saved Wifi Password

Alternatively, you can use the grep command to show the password of a connected Wi-Fi password.

sudo grep -r '^psk=' /etc/NetworkManager/system-connections/
Saved Wifi Password Saved Wifi Password 2

If you want to refine the output even more to display only the password, modify the command as follows:

sudo grep -hr '^psk=' /etc/NetworkManager/system-connections/

Good to know: Learn how to control your Wi-Fi network in Linux.

Show Saved Wi-Fi Password Using Nmcli

Nmcli is a tool for controlling the Network Manager through the terminal. It can be used to edit, create, display, delete, deactivate, activate, and delete network connections. You can also use it to display the network device status.

Viewing saved Wi-Fi passwords using nmcli is perhaps the easiest way to view saved passwords. The procedure is as follows:

  1. Launch the Linux terminal.
  2. Run this command to view saved wireless and wired connections.
nmcli -g NAME connection show
Nmcli Connections Show
  1. Now that you have identified the name of the saved Wi-Fi, type in this command. In this illustration, MTE-Test-Wifi is the name of my Wi-Fi network.
nmcli -s -g 802-11-wireless-security.psk connection show MTE-Test-Wifi 
Showing Wifi Password Using Nmcli

Note: if your Wi-Fi name has more than one word, remember to enclose it in apostrophes so that the terminal understands that it is a single name.

Good to know: use portmaster to protect your computer and network.

Showing Saved Wi-Fi Password Using Graphical User Interface

If you are not a fan of the Linux terminal, you can also use this GUI method. For this demonstration, we are using the Linux Mint Cinnamon edition.

The following is a step-by-step guide on how to view saved Wi-Fi passwords using GUI:

  1. In the task manager, click on the Network option.
  2. Click on “Network Settings.”
Network Options in Linux desktop

Alternatively, open your launcher menu and search for “Network Settings.” It should open the same settings page.

The page should contain a list of all saved Wi-Fi networks.

Network Settings Page
  1. Click on the settings icon next to the Wi-Fi network in which you wish to extract the password.
Connected Wifi Details Settings

This page displays all the configurations of the related Wi-Fi network.

  1. Under the “Security” tab, check the “Show Password” checkbox.
Wifi Security Settings showing saved password

Your password should be displayed. Click “Cancel” to exit the Settings menu.

Frequently Asked Questions

What is netsh in Linux?

Netsh is a command-line utility that enables a user to, either remotely or locally, display or alter the network configuration of a computer. Netsh also provides a feature that enables a user to run multiple tasks in batch mode. This can be helpful when changing settings on many computers at once.

Netsh is not installed by default on most Linux distros but is available in the repositories of most major distributions.

Can I see saved Wi-Fi paswords without root access?

Yes. While the terminal may require the account password to edit network configuration files, you can use the nmcli command-line utility. Alternatively, you can view the saved Wi-Fi password using the graphical user interface method. 

How do I change my Wi-Fi passwords in Linux? 

Changing a Wi-Fi password in a Linux GUI environment is simple. Open the network manager and update the password in the security tab of the Wi-Fi connection you wish to alter. However, if you have to use the terminal, things may get a little advanced. The easiest way to achieve this is to edit the file containing the Wi-Fi connection configuration details in the “/etc/NetworkManager/system-connections” directory. Open the file and change the psk value in the “Wi-Fi Security” option.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Allan Ngetich Avatar

Read next

Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
A species of jellyfish called Turritopsis dohrnii can revert its adult cells back to a juvenile polyp stage when injured or starving, effectively restarting its life cycle, and biologists have so far failed to identify any natural limit to how many times it can do this.
A Japanese man named Jiroemon Kimura, who lived to 116, was born in 1897 when Queen Victoria still ruled and died in 2013, meaning a single human life personally overlapped with the invention of the airplane, the atomic bomb, the internet, and Instagram
The Hollywood sign originally read HOLLYWOODLAND when it was built in 1923 as a real estate advertisement for a housing development, and it was only meant to stand for 18 months, but nobody ever got around to taking it down and the city eventually adopted it as a landmark
Almost all of the world’s internet traffic does not travel by satellite but through fibre-optic cables lying on the ocean floor, a hidden web of wires crossing the deepest parts of the sea to connect the continents.
People who flip their phone face down on every table aren’t being secretive. They figured out that staying interruptible meant handing their time to whoever rang first
Twitch vs. Facebook Gaming vs. YouTube Gaming: What’s the Best Live Game Streaming Platform?
Chrome Extensions Ownership Transfer is a Direct Threat to You: How to Stay Safe