Finding your Wifi password and other Wifi secrets

Tips and Tricks for Networking

Moderator: jkerr82508

User avatar
Posts: 9171
Joined: 14 Mar 2010, 16:34

Finding your Wifi password and other Wifi secrets

Postby viking60 » 17 Aug 2017, 08:53

Most distros today come with NetworkManager.
NetworkManager comes with a CLI (command line interface) function called nmcli.

If you have networkmanager then you probably also have nmcli - if not; you can install it.

When you first connect to your Wi-Fi you have the password from your ISP and forget it! +1

So when your brother comes to visit and wants to hook up his iPhone to your wifi - you can't help him :oops:

Well you could call your ISP and stand on your head to get the password again (or find it in GUI), but there is a better way:

Find your connection with:

Code: Select all

nmcli device

this will show something like this:

Code: Select all

DEVICE   TYPE      STATE        CONNECTION         
docker0  bridge    connected    docker0           
wlp2s0   wifi      connected    Wi-Fi connection 1

We are interested in the Wi-Fi connection name for wifi - in this case it is "Wi-Fi connection 1"

Once we have established that; we can reveal all the secrets of that connection - including password with:

Code: Select all

nmcli --show-secrets connection show "Wi-Fi connection 1"

The password will be on a line called something like 802-11-wireless-security.psk

It is that easy.

Of course you will never remember this command so why not make an alias - like this:

Code: Select all

alias wifisecrets='nmcli --show-secrets connection show "Wi-Fi connection 1"'

Or maby make it password specific;

Code: Select all

alias wifipassword='nmcli --show-secrets connection show "Wi-Fi connection 1" |grep 802-11-wireless-security.psk'

Now you can simply type wifipassword in a terminal and there it is +1
Time for me to reveal a little secret in the end:
This is not limited to wifi :-D
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
Posts: 2416
Joined: 17 Mar 2010, 15:40

Re: Finding your Wifi password and other Wifi secrets

Postby R_Head » 17 Aug 2017, 13:13

Pretty good...

On my case, I have an ACL and limted amount of reserved IPs :lol:

When visit wants to use my WiFi, I enable my Cell Phone hotspot. It has an old Unlimited Data plan that ATT wants me to get off it. :mrgreen:

Return to “Networking”