- How to find the saved Wifi Password in Ubuntu
- 2 Answers 2
- One-liner
- Как посмотреть сохраненные пароли WiFi в Ubuntu Linux
- Просмотр паролей WiFi через настройки системы
- Просмотр паролей WiFi из командной строки
- How To Find Saved Wi-Fi Passwords in Ubuntu and Other Linux Distributions
- Method 0: Use nmcli command to get password of currently connected network
- Method 1: Find saved WiFi password in Ubuntu using the GUI
- See all the previously connected networks (and their password)
- Method 2: Finding saved WiFi password via the terminal
- How to View Saved WiFi Passwords on Debian 10
- View Saved WiFi passwords through the Debian’s Settings Utility (UI)
- View Saved WiFi passwords through the Debian’s Terminal application (command line)
How to find the saved Wifi Password in Ubuntu
I connected my laptop with my home Wifi connection but now I forget the password and I want to login on my mobile device as well. Can you tell me how can I check my saved password so that I can use it on my mobile? Or do I need to change the Wifi Password by accessing the router’s settings?
2 Answers 2
Open up a terminal ( Ctrl + Alt + t ) then issue:
cd /etc/NetworkManager/system-connections ls -la
Now just cat out whichever file matches the connection you need to view:
sudo cat 'my_cool_network' # you MUST use sudo as file is root owned. quote if file name contains spaces
In output look for something like this:
[wifi-security] auth-alg=open key-mgmt=wpa-psk psk=ele55Hroad
As you can see my WiFi password is ele55Hroad
Above works on Ubuntu 18.10+
One-liner
sudo grep --with-filename psk= /etc/NetworkManager/system-connections/*
$ sudo grep --with-filename psk= /etc/NetworkManager/system-connections/* /etc/NetworkManager/system-connections/SHAW-999999:psk=99999A999999 /etc/NetworkManager/system-connections/SHAW-999999-5G:psk=99999A999999 /etc/NetworkManager/system-connections/SHAW-999999-5G:psk=999999999999
After » system-connections/ » you will see your WiFi network name. EG » SHAW-999999 «. Then you will see your password after » :psk= «. EG » 99999A999999 «. WiFi network name and password were redacted in case my neighbour is hoping for a free bus ride 🙂
Как посмотреть сохраненные пароли WiFi в Ubuntu Linux
Когда мы подключаемся по WiFi к какой-нибудь сети, то обычно вводим пароль и сохраняем его, чтобы дальнейшие подключения к данной сети выполнялись автоматически. Введенный пароль сохраняется в системе.
Рассмотрим, как посмотреть сохраненные пароли для WiFi соединений в Ubuntu Linux.
Просмотр паролей WiFi через настройки системы
Пароль WiFi в Ubuntu Linux можно посмотреть через Параметры системы. Чтобы открыть Параметры системы вы можете кликнуть по иконке WiFi на панели в области уведомлений, и в открывшемся окошке нажать кнопку с символом «настроек».
В окне Параметров системы перейдите на вкладку Wi-Fi и в списке сетей нажмите на значок «настроек» для той сети, пароль которой вы хотите посмотреть.
Откроется окно настроек выбранной WiFi сети. Перейдите на вкладку Безопасность и поставьте галочку в поле Показывать пароль . Пароль от данной Wi-Fi сети отобразится в текстовом поле:
Просмотр паролей WiFi из командной строки
Теперь рассмотрим, как посмотреть пароль WiFi сети из командной строки.
Настройки WiFi соединений сохраняются в конфигурационных файлах, хранящихся в директории /etc/NetworkManager/system-connections . В этих же файлах прописаны пароли от WiFi соединений.
Выполним следующую команду, чтобы найти сохраненные WiFi пароли:
sudo grep psk= /etc/NetworkManager/system-connections/*
В результате получим одну или несколько строк для каждого сохраненного WiFi соединения. В конце каждой строки будет запись вида psk=пароль
Вы также можете найти пароль внутри конфигурационного файла соответствующей WiFi сети. Пример файла с настройками WiFi-соединения /etc/NetworkManager/system-connections/НазваниеСети :
How To Find Saved Wi-Fi Passwords in Ubuntu and Other Linux Distributions
When you connect to a wireless network using WPA or WPA2-PSK, Ubuntu saves the password to your system when you use the “connect automatically” option.
You may find yourself in a situation to know the Wi-Fi password. For example, if you need to provide the password to a visitor and you have not noted it down elsewhere.
Thankfully, all the network settings are stored properly and can be retrieved along with wireless password anytime you want.
I’ll show you both GUI and command line ways to see the saved WiFi passwords in Ubuntu and hopefully other Linux distributions.
Method 0: Use nmcli command to get password of currently connected network
This method should work on all Linux distributions that use network-manager. You just have to use this single command to get the details of the currently connected wifi network. You also get a QR code that can be shared with other people to connect to the network.
nmcli device wifi show-password
Method 1: Find saved WiFi password in Ubuntu using the GUI
The procedure to find saved WiFi passwords is quite simple. Launch the Settings application from the gnome applications menu.
Here, in the Wi-Fi tab, you’ll find a list of available WiFi networks and the ones you’ve connected to in the past. Click on the gear icon in the row corresponding to the network whose password you want to find.
In the Security tab and check the Show Password button to reveal the password.
That works for the currently connected networks. What about the networks to which you had connected in the past but that are not available anymore?
See all the previously connected networks (and their password)
In Ubuntu and other distributions using the GNOME desktop, you get an Advanced Network Configuration GUI tool.
When you start this tool, it shows all the networks that you had connected to previously. You can select the desired one and then click on the gear symbol at the bottom to access its settings.
It will give you the same interface you had seen earlier. Go to the Wi-Fi Security tab and click on the show password to see the password that you had used to connect to the said network.
Method 2: Finding saved WiFi password via the terminal
Ubuntu uses Network Manager to handle network related settings. These settings can be found in the /etc/NetworkManager directory.
The details of networks you have connected to in the past are stored in separate files in the sub-directory /etc/NetworkManager/system-connections.
In the associated file, the password for the network connection can be found under the wifi-security section, in the line that starts with psk.
sudo cat /etc/NetworkManager/system-connections/.nmconnection
Replace with the name of the desired WiFi network and make sure there is a “\” before every space in the network’s name (if any).
Voilà, here is the password you were looking for. You can use this method to see saved Wi-FI password in Linux Mint and other distributions.
How did you find the tutorial? Was it helpful? Do let me know in the comment section.
How to View Saved WiFi Passwords on Debian 10
Whenever we connect to a WiFi network, we enter the password, and if we have to use this network on a regular basis, we simply check the “connect automatically” option for future use. However, we rarely note down the password manually somewhere in a file for future reference. The problem arises when we need the password again, for example when a visitor asks for it. Fortunately, our Debian system saves this password, and all the connection configurations, for all the wireless connections you ever connected to. These are referred to as your “known” wireless connections. These passwords and other configurations can be easily retrieved both through the Debian command line and the graphical user interface.
In this article, we will describe two ways for you to find the saved passwords for your wireless connections:
- Through Debian Settings Utility(UI)
- Through the Debian’s Terminal application (command line)
We have run the commands and procedures mentioned in this article on a Debian 10 Buster system although they are applicable to slightly older versions of Debian as well.
View Saved WiFi passwords through the Debian’s Settings Utility (UI)
The Debian Settings utility lets you manage your network connections, including the wireless ones. In order to fetch the password for a wireless connection, we will be using the WiFi view in the Settings utility.
You can open this view from the following three methods:
1. Enter the WiFi keyword in the application launcher search bar as follows:
Then click on the Wi-Fi search result. This will open the Settings utility. Click on the Wifi tab to move to the Wi-Fi view.
2. Click on the downward arrow located at the top-right corner of your Debian desktop.
Then click the settings icon, as shown above, from this menu. This will open the Settings utility which you can use to access the Wi-Fi tab.
3. Click on the downward arrow located at the top-right corner of your Debian desktop.
Then click on the name of the connected WiFi connection and select Wi-Fi Settings from the sub-menu. This will open the Settings utility in the Wi-Fi view.
In case no WiFi connection is connected, click on the “Wi-Fi Off” option from the menu.
This is how the Wi-Fi view looks like in the Setting utility:
Here, click the settings icon adjacent to the “known” connection whose password you want to fetch. A known connection is the one you have ever connected to. This will open the Details of that WiFi connection. Click on the Security tab to view the security settings:
Here, you will be able to see the Password field. By default, the password is kept confidential in asterisks form. Select the Show Password option in order to view the password in an alphanumeric format as follows:
This is how you can fetch the password of any Wi-Fi connection whose details are saved on your Debian.
View Saved WiFi passwords through the Debian’s Terminal application (command line)
For a Terminal-savvy person, the Debian command line has a solution to all the administrative and configuration related problems. In fact, the command line gives a greater control to a Debian admin to make/view minute configuration details.
Anyways, let us see how we can make use of the command line to fetch saved passwords for our WiFi connections. The configuration details about your know wireless/WiFi connections are saved in the /etc/NetworkManager/system-connections directory. Individual configuration files are maintained for all your WiFi connections here.
Open your Debian command line, the Terminal, through the Debian application launcher search bar as follows:
Then enter the following command as sudo:
$ sudo grep psk= /etc/NetworkManager/system-connections/*
The purpose of this command is to fetch the psk(password) value from the respective WiFi connection configuration files. Since only an authorized user is allowed to view/change the content of these files, you need to run the command as sudo.
This is how a wireless connection file looks like:
The psk value corresponds to the saved password for the WiFi connection that you are looking for.
So these were two ways to fetch saved password for your WiFi/Wireless connections. You can now share them with visitors so that they can use the WiFi too.