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.
Showing Saved Wi-Fi Password Using the Linux Terminal
- Open the terminal. You can achieve this by using the CTRL + ALT + T shortcut or your launcher menu.
- Navigate to “/etc/NetworkManager/system-connections/”:
- View the files contained in the directory by running the
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.
- 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
Under the Wi-Fi security section, the Wi-Fi password should be displayed as psk=”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/
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:
- Launch the Linux terminal.
- Run this command to view saved wireless and wired connections.
nmcli -g NAME connection show
- 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
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:
- In the task manager, click on the Network option.
- Click on “Network Settings.”
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.
- Click on the settings icon next to the Wi-Fi network in which you wish to extract the password.
This page displays all the configurations of the related Wi-Fi network.
- Under the “Security” tab, check the “Show Password” checkbox.
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.
Our latest tutorials delivered straight to your inbox