11

I connected my laptop with my home Wifi connection but now I forget the password and I want to login on my mobile device as well. Can you tell me how can I check my saved password so that I can use it on my mobile? Or do I need to change the Wifi Password by accessing the router's settings?

0

2 Answers 2

17

Open up a terminal ( Ctrl+Alt+t ) then issue:

cd /etc/NetworkManager/system-connections
ls -la 

Now just cat out whichever file matches the connection you need to view:

sudo cat 'my_cool_network' # you MUST use sudo as file is root owned. quote if file name contains spaces

In output look for something like this:

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=ele55Hroad

As you can see my WiFi password is ele55Hroad

Above works on Ubuntu 18.10+

1
  • Also works on Ubuntu 16.04. Just tried it and posted a shorter answer based on yours. Dec 6, 2021 at 0:16
1

One-liner

A one-liner you can use:

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

For example:

$ sudo grep --with-filename psk= /etc/NetworkManager/system-connections/*

/etc/NetworkManager/system-connections/SHAW-999999:psk=99999A999999
/etc/NetworkManager/system-connections/SHAW-999999-5G:psk=99999A999999
/etc/NetworkManager/system-connections/SHAW-999999-5G:psk=999999999999

After "system-connections/" you will see your WiFi network name. EG "SHAW-999999". Then you will see your password after ":psk=". EG "99999A999999". WiFi network name and password were redacted in case my neighbour is hoping for a free bus ride :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.