Wi-Fi networks, get passwords for saved networks

about get WiFi network password

In the next article we are going to take a look at how we can see the password of the WiFi networks to which we connect at some point. When users connect to a wireless network for the first time, the password will be saved on our Ubuntu computer. For this reason, it is not necessary to retype the password each time we reconnect to the same Wi-Fi network.

As time goes by, and when we want to add a new device to the same Wi-Fi network, we may no longer remember the necessary password. If you find yourself in this situation, Ubuntu users (and other Gnu / Linux systems) we will be able obtain from the terminal the passwords of the Wi-Fi networks to which we had previously connected. We can also see from the graphical environment and in a simple way the password of these networks to which we connect at some point.

Find the password of the Wi-Fi networks you connected to with Ubuntu

As I said, in Ubuntu we can find the password of the wifi networks saved from the command line or from the graphical environment. The following steps I tried on Ubuntu 20.04 LTS desktop (GNOME)However, these steps are probably the same in other distributions.

From the terminal

In Ubuntu and its variants, the wireless network configuration files are stored in the directory / etc /NetworkManager/ system-connections /. If we open a terminal (Ctrl + Alt + T) we will be able to take a look at the configuration files of the Wi-Fi networks to which we connect from our computer:

directory content networkmanager system-connections

ls /etc/NetworkManager/system-connections/

As you can see from the above screenshot, I have 2 network configuration files saved on my Ubuntu 20.04 system. In these files we will find different details of each network such as wifi id, SSID, authentication method, wifi password, etc. To consult each of these files, we will simply have to use the command cat or some text editor to see the password of the network that interests us.

For this example I will see the details of the wifi network "dlink.nmconnection”Using in a terminal (Ctrl + Alt + T) the command:

directory data networkmanager system-connections

sudo cat /etc/NetworkManager/system-connections/dlink.nmconnection

Onscreen different values ​​will appear, among them we will find PSK, which is the password of the given wifi network. For those wondering what this is, PSK (pre-shared key) is a client authentication method. It uses a string of 64 hexadecimal digits, or as a passphrase of 8 to 63 ASCII characters to generate encryption keys.

Another way to check passwords is to use the grep command. So we can find the password of the saved Wi-Fi networks, as it's shown in the following:

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

This command will display the password for all saved wireless networks.

Another way to obtain the passwords will be to use a variant of the previous command How is it:

PSK data

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

If we don't want to see the names of SSID of Wi-Fi networks and see only passwords, you just have to add to the previous command the -h option:

PSK data without SSID

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

Use the -h option it can be a problem if we have more than one network saved. When using this option we will not know which network each of the passwords is fromas the SSID is not displayed.

From Network Manager (GUI)

If you would like to see only the password of the Wi-Fi networks you previously connected to and you prefer to use the graphical environment instead of using the terminal, you will only have to click on the network icon located on the top panel of the desktop. There the drop-down menu will appear. If we do click on wifi option, another menu will be displayed. Here we will find the option 'Wi-Fi setup', on which we will have to click.

WiFi configuration option

In the window that will open we will see a list of the currently available networks. There we can click on the "Settings" icon that we will see next to the Wi-Fi networks to which we would have connected at some point.

WiFi configuration from desktop

Now the configuration window of the selected Wi-Fi network will open. In the 'Security' tab, we will see the password with asterisks. To reveal the password, there will just be more to click on the checkbox 'Show password'.

show WiFi password from desktop

These two are simple ways to check the passwords of the Wi-Fi networks to which we connect. What's more we can find many password recovery tools available on Kali Linux. There is no reason to install Kali Linux, we just have to install available tools on our Ubuntu system and use the password recovery tools.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Juan Antonio said

    Thank you very much, it was very useful and well explained.