This quick tutorial explains the steps to view saved WiFi password in Ubuntu and Other Linux.
If you use wireless connections and frequently connect to a list of WiFi access points, then you tend to save the password for seamless connectivity in Ubuntu and other systems. However, you may forget the password after a certain period. Here’s how you can quickly find it out.
In Linux, there are two ways you can view the passwords – a) via Terminal method and b) GUI method.
The terminal method is the recommended way to view the saved password. Because irrespective of the Linux distribution, desktop – this works.
However, the GUI method differs based on which desktop environment you use. The reason is the system settings dialogs are different in GNOME, KDE Plasma, Xfce, LXQt, etc.
Table of Contents
View Saved WiFi Password
Terminal Method (recommended)
Open a terminal and go to the path /etc/NetworkManager/system-connections/ via the following command. And list the profiles.
cd /etc/NetworkManager/system-connections/
ls -a
This path contains the WiFi profiles and their details. Each WiFi connection has separate profile entries, which are saved and connected earlier.
Use the following command to display the contents of the files.
sudo cat [name of profile]
In the file, under [wifi-security], you should find the saved password with key psk. See an example below.
This way, you can easily find out the saved WiFi password via the terminal.
Getting the password via the terminal for the connected access point
If you want to find out the password of your WiFi access point, which is currently connected, then simply run the following command to show it. It will give you the password immediately with a QR code to share the connection. Remember, this should work only on latest series of Linux distributions.
nmcli device wifi show-password

GUI Method
GNOME (used by Ubuntu, Fedora, and others as default)
Open Settings. Then click on WiFi. Under the Visible network, find your WiFi access point (AP) name. Click on the small gear icon beside the AP.
Then go to the Security tab aand click Show password to view the saved password.
KDE Plasma
Open System Settings. Under Network, click on Connections. Click on the WiFi connection name and go to the WiFi security tab. Click on the small eye icon to find out the saved password.
Xfce
Xfce doesn’t have any dedicated GUI for finding out the saved password. So follow the above terminal method.
I hope this guide helped you find out the saved password, which you may have forgotten. Cheers.