Appearance
If you have forgotten the password key for a Wi-Fi network but happen to have a device in which the password has been saved, it would be helpful to know how to retrieved the saved password back from the device.
For obvious security reasons, this might not be possible in every situation, but below I'll outline some steps that can be taken and might be useful for particular situations, covering some different Operating Systems.
On Windows devices ​
Under Windows, this is easily done by using the netsh utility.
powershell
netsh wlan show profile
This would return the list of known saved wireless networks, displaying the SSID (the name of the network) for each of them.
Profiles on interface Wi-Fi:
Group policy profiles (read only)
---------------------------------
<None>
User profiles
-------------
All User Profile : YOUR_WLAN_NAME
All User Profile : otherWlanName
All User Profile : wlanTestEssid
Confirm that the name of the network you'd like to get the information from is there and use it to obtain its details with the below command:
powershell
netsh wlan show profile YOUR_WLAN_NAME key=clear
The password for the wireless network corresponds to the field "Key Content" under "Security Settings". An example is shown below:
Profile YOUR_WLAN_NAME on interface Wi-Fi:
=======================================================================
Applied: All User Profile
Profile information
-------------------
Version : 1
Type : Wireless LAN
Name : YOUR_WLAN_NAME
Control options :
Connection mode : Connect manually
Network broadcast : Connect even if this network is not broadcasting
AutoSwitch : Do not switch to other networks
MAC Randomization : Disabled
Connectivity settings
---------------------
Number of SSIDs : 1
SSID name : "YOUR_WLAN_NAME"
Network type : Infrastructure
Radio type : [ Any Radio Type ]
Vendor extension : Not present
Security settings
-----------------
Authentication : WPA2-Personal
Cipher : CCMP
Authentication : WPA2-Personal
Cipher : GCMP
Security key : Present
Key Content : MyVerySecretPAssword-1234
Cost settings
-------------
Cost : Unrestricted
Congested : No
Approaching Data Limit : No
Over Data Limit : No
Roaming : No
Cost Source : Default
On Linux devices ​
The method to check this might vary depending on what network configuration system is being used.
A common network subsystem in many modern distribution is "Network Manager", which stores the saved connections under the path /etc/NetworkManager/system-connections/
.
sh
ls /etc/NetworkManager/system-connections/
There should be a file there for each saved connection, with extension .nmconnection
. The format of the files is INI based.
By default, NetworkManager stores the passwords of the saved connections in plan text, although they should only be readable with root permissions.
You should be able to read the password for any particular file by checking the psk
attribute within the [wifi-security]
section. For example, the command below will show it for all saved connections.
sh
grep -r '^psk=' /etc/NetworkManager/system-connections/