Find the password for the currently connected wireless network

I want to find the password for the wireless network that I am currently connected to (and I entered the password when connecting to the network). How can I do this in Ubuntu?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Left click the connections icon at the top right.

Choose edit connections and then choose edit on the connection you need and click the wireless security.


And click the ‘show password’checkbox


Solution 2

If you want to do this with the command line, the wireless network configuration files are saved in the /etc/NetworkManager/system-connections/ directory. You can get them all at once like this:

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

This will give you output like this:


You can suppress the filename with the -h flag:

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

The output is easier to read at a glance:


Solution 3

Open a terminal (press Ctrl+Alt+T), then type:

sudo cat /etc/NetworkManager/system-connections/<your-SSID>

(Of course, substitute <your-SSID> with your network’s name.)

Look for the line named psk. This should contain your password, after the = sign.


Solution 4

In the command line:

nmcli dev wifi show-password

Solution 5

This will give you the password for your current connection.

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


sudo grep psk= /etc/NetworkManager/system-connections/(YOUR-SSID)

Solution 6

here is a one liner to make @David Foerster answer more useful

MYCWD=`pwd`; cd /etc/NetworkManager/system-connections/ ; sudo grep -e '^psk=' * | less ; cd $MYCWD

Solution 7

you can just type ls /etc/NetworkManager/system-connections/
and it will show the name of your network, so just press the up arrow on keyboard and type the name of your connections and change ls to sudo cat

the password will be psk

Solution 8

Using nmcli on Ubuntu 18.04, replace WIFINAME with the wireless network name (ssid):

nmcli --show-secrets connection show WIFINAME | grep 802-11-wireless-security.psk:

show-password does not work for me

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply