Find the password for the currently connected wireless network

134,124

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.

1

And click the 'show password'checkbox

2

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:

/etc/NetworkManager/system-connections/MyExampleSSID:psk=12345
/etc/NetworkManager/system-connections/AnotherSSID:psk=password

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:

psk=12345
psk=password

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.

psk=notreallymypassword

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/*

Or

sudo grep psk= /etc/NetworkManager/system-connections/(YOUR-SSID)
Share:
134,124

Related videos on Youtube

Anderson Green
Author by

Anderson Green

I write source-to-source compilers in JavaScript using Peggyjs. I also write compilers in Prolog. For reference, I also have a list of source-to-source compilers on GitHub.

Updated on September 18, 2022

Comments

  • Anderson Green
    Anderson Green over 1 year

    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?

    • Anderson Green
      Anderson Green almost 12 years
      I went to "connection information" and didn't find the password.
    • Rinzwind
      Rinzwind almost 12 years
      almost there... you need the edit connections below that ;)
  • BlitZz
    BlitZz almost 12 years
    Ah, my command-line ways were betrayed by my solution :) I like this one better, FWIW.
  • Rinzwind
    Rinzwind almost 12 years
    Well I like both with a preference to command line @roadmr :D
  • Wong Jia Hau
    Wong Jia Hau over 5 years
    This is working charmly
  • Chris J.T. Auld
    Chris J.T. Auld over 2 years
    First one down the line that worked perfectly.
  • tobiasBora
    tobiasBora over 2 years
    This one is not only the only working solution for me, but it even displays a nice Qr code (yes in command line!) that you can scan on your mobile to quickly add the wifi! Thanks a lot!