Wi-Fi hotspots are everywhere, in our homes, public buildings and cafes. This makes Wi-Fi one of the most common ways to connect to the Internet from your computer.
Did you know that on Linux, you can easily check all the Wi-Fi networks you have previously connected to? You can even view saved Wi-Fi passwords on Linux with nmcli.
What is nmcli?
The nmcli utility (short for NetworkManager Command Line Interface) is a powerful command line tool for managing NetworkManager, a daemon used to manage network settings and connections in Linux.
You can use nmcli to manage Wi-Fi networks in general, such as listing and connecting to a Wi-Fi network from your Linux PC. It's also especially useful in network scenarios or on non-GUI servers.
Installing nmcli on Linux
Most distributions have nmcli installed by default, but if yours doesn't have it, here's how to proceed.
To install nmcli on Debian based distributions such as Ubuntu, MX Linux and Pop!_OS, use the APT package manager:
sudo apt update & sudo apt install network-manager
On RHEL and similar distributions like Alma Linux, Fedora, Rocky Linux, etc., you can use the DNF package manager like this:
sudo dnf install NetworkManager
On Arch Linux based distributions, you can install nmcli with Pacman: sudo pacman -S networkmanager
View saved wifi networks with nmcli
To view information about all Wi-Fi networks that you have previously connected to on your PC, run the following command:
nmcli connection show | grep wifi
If you don't filter with grep, nmcli lists all networks, including wired networks, bridged connections, and VPN connections.
The output of the previous command will look like this:
The Wi-Fi name or SSID (Service Set Identifier) is listed in the first column, followed by the UUID (Universally Unique Identifier) and then the network type (Wi-Fi in this case). Finally, the last column shows the network device type.
Viewing Saved Wi-Fi Passwords in Linux
You need elevated Linux privileges to view saved passwords with nmcli.
You can check the password of a known Wi-Fi network using:
sudo nmcli connection show WiFiName -s | grep psk
... where WiFiName is the name of the WiFi network you are interested in.
For example, to view the password of a Wi-Fi network named "iPhone", do the following:
sudo nmcli connection show iPhone -s | grep psk
The iPhone Wi-Fi password is listed as "test1234".
If you're wondering where nmcli stores its Wi-Fi configuration files, they're located in the /etc/NetworkManager/system-connections directory.
2568510cookie-checkHow to view saved Wi-Fi passwords in Linuxno
similar
Publication author
offline 1 week
Comments: 6Publications: 1195Registration: 29-04-2020
Обзоры,Программы
#View #Saved #WiFi #Passwords #Linux