How to Retrieve Your WiFi Password Using the Terminal- A Step-by-Step Guide
How to View WiFi Password on Terminal
In today’s digital age, WiFi has become an integral part of our lives. Whether you’re at home, in the office, or on the go, having a stable internet connection is crucial. However, there may be instances when you need to view the WiFi password for various reasons, such as sharing it with friends or family or troubleshooting connectivity issues. In this article, we will guide you on how to view WiFi password on terminal, which is a useful skill for Linux and macOS users.
Using the `iwconfig` Command
One of the simplest ways to view the WiFi password on a Linux or macOS terminal is by using the `iwconfig` command. This command displays various information about the wireless interface, including the SSID (network name) and the authentication type. To view the WiFi password, follow these steps:
1. Open the terminal on your Linux or macOS system.
2. Type `iwconfig` and press Enter.
3. Look for the line that starts with “ESSID:” in the output. This line shows the network name.
4. Next, find the line that starts with “Authentication type:” and note down the authentication type. It should be “Open” if the password is set.
5. The WiFi password is not directly displayed using `iwconfig`. However, you can use the `grep` command to search for the password in the `/etc/wpa_supplicant/wpa_supplicant.conf` file, which stores WiFi configuration details.
Using the `grep` Command
To find the WiFi password in the `/etc/wpa_supplicant/wpa_supplicant.conf` file, follow these steps:
1. Open the terminal on your Linux or macOS system.
2. Type `sudo grep -A 10 ‘ssid’ /etc/wpa_supplicant/wpa_supplicant.conf` and press Enter. Replace ‘ssid’ with the actual network name you want to search for.
3. The output will display the WiFi configuration details, including the password. Look for the line that starts with “psk=” to find the password.
Using the `nmcli` Command
If you’re using a newer version of Linux, you can also use the `nmcli` command to view the WiFi password. This command is part of the NetworkManager package, which is responsible for managing network connections in Linux systems.
1. Open the terminal on your Linux system.
2. Type `sudo nmcli con show | grep ‘ssid’` and press Enter. Replace ‘ssid’ with the actual network name you want to search for.
3. The output will display the WiFi configuration details, including the password. Look for the line that starts with “802-1x-password=” to find the password.
Conclusion
Viewing the WiFi password on terminal is a straightforward process for Linux and macOS users. By using the `iwconfig`, `grep`, and `nmcli` commands, you can easily find the WiFi password and share it with others or troubleshoot connectivity issues. Keep in mind that these commands may require administrative privileges, so you may need to use the `sudo` command to execute them.