How to view your Wi-Fi password on a Linux computer: all the methods

Forgot your home Wi-Fi password, but it's saved on your Linux PC? Don't rush to reset your router or call your ISP. Most Linux distributions have Ubuntu And Debian to Arch Linux And Fedora Wireless network passwords are stored in system files and can be retrieved even without administrator rights. The main thing is to know where and how to look for them.

In this article we will look at 5 working methods, including terminal commands, graphical utilities, and manual search through configuration files. You'll learn how to get the password for the current connection, view all saved networks, and what to do if the system prompts you. sudo, and you don't have superuser rights. These instructions are relevant for modern versions. NetworkManager, Wicd And connman — the most common network managers in Linux.

Method 1: via the NetworkManager graphical interface (the easiest)

If you use GNOME, KDE Plasma or another popular graphical shell, most likely your system manages Wi-Fi via NetworkManagerIn this case, the password can be viewed without a terminal, using the standard settings.

Open the networks menu in the upper right corner of the screen (Wi-Fi icon) and follow these steps:

  • 📋 Find your Wi-Fi network in the list and right-click on it. Select Change connection or Edit Connections (in the English version).
  • 🔑 In the window that opens, go to the tab Wi-Fi Security (or Wi-Fi Security).
  • 👁️ Check the box next to Show password (or Show password). The password will be displayed in the field. Key.
⚠️ Attention: In some distributions (for example, Linux Mint With Cinnamon) This method may not work if you are not logged in as an administrator. In this case, use the terminal commands in the following sections.

If the point Change connection not in the context menu, try the alternative path:

  1. Open System settingsNet (or Network).
  2. Find your Wi-Fi network in the list and click on the settings gear.
  3. Go to the tab Security and enable password display.
📊 Which Linux distribution are you using?
Ubuntu/Debian
Arch Linux/Manjaro
Fedora/RHEL
OpenSUSE
Another

2. Method: command nmcli for NetworkManager (universal)

Utility nmcli - is a console interface for NetworkManager, which works on all distributions where this manager is installed (which is 90% of modern Linux systems). With its help, you can find out the password for one team, without even knowing the network name.

Open Terminal (Ctrl+Alt+T) and run:

nmcli -s -g 802-11-wireless-security.psk device wifi show-password

If the command doesn't work, try the alternative option (shows the password for current connection):

nmcli -g 802-11-wireless-security.psk connection show "$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d':' -f2)"

Command Explanation:

  • 🔍 nmcli connection show — displays information about saved connections.
  • 📡 802-11-wireless-security.psk — the parameter in which the password is stored.
  • 🔄 $(...) — substitutes the name of the currently active network.
⚠️ Attention: If you saw the message Error: no secrets, it means the password is not saved in the system (for example, you connected via WPS or entered it manually each time you connected). In this case, try the file method /etc/NetworkManager/system-connections/ from section 4.

☑️ Preparing to use nmcli

Completed: 0 / 4

Method 3: View all saved Wi-Fi passwords

If you need to see all passwords from the networks the computer has ever connected to, use this command:

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

As a result, you will get a list of files with network names and lines of the form psk=your_password. For example:

/etc/NetworkManager/system-connections/MyWiFi.nmconnection:psk=12345678

To see only passwords (without file paths), add | cut -d'=' -f2:

sudo grep 'psk=' /etc/NetworkManager/system-connections/* | cut -d'=' -f2

If you don't want to use sudo, you can view the files manually:

  1. Go to the folder: cd /etc/NetworkManager/system-connections/
  2. See the list of networks: ls
  3. Open the file you need (for example, nano MyWiFi.nmconnection) and find the line psk=.
Team What does it do? Requires sudo?
nmcli -s -g 802-11-wireless-security.psk device wifi show-password Shows the password of the current network No
sudo grep 'psk=' /etc/NetworkManager/system-connections/* Displays all saved passwords Yes
cat /etc/NetworkManager/system-connections/MyWiFi.nmconnection Shows the configuration of a specific network No (if the file is available)
wpa_passphrase MyWiFi Generates a password hash (does not show the original) No

4. Method: Manual search in configuration files

If the commands don't work or you prefer the manual approach, Wi-Fi passwords are stored in text files with the extension .nmconnectionHere's how to find them:

  1. Open your file manager with administrator rights (for example, sudo nautilus V GNOME or sudo dolphin V KDE).
  2. Go to the folder /etc/NetworkManager/system-connections/.
  3. Find the file with the name of your network (eg. MyHomeWiFi.nmconnection) and open it with any text editor.
  4. In the section [wi-fi-security] there will be a line psk=your_password.

In some distributions (for example, Fedora With GNOME 40+) passwords can be stored in encrypted form in /var/lib/NetworkManager/In this case, without sudo It will not be possible to read them.

Example file contents .nmconnection:

[connection]

id=MyWiFi

type=wifi

interface-name=wlp3s0

[wifi]

ssid=MyWiFi

[wifi-security]

key-mgmt=wpa-psk

psk=MySuperSecretPassword123

[ipv4]

method=auto

[ipv6]

method=auto

⚠️ Attention: Do not edit these files manually unless you are sure of the format! A syntax error may result in connection loss. To make changes, use nmtui or the NetworkManager graphical interface.

Method 5: for distributions without NetworkManager (Wicd, ConnMan)

If your distribution uses alternative network managers (eg. Wicd V AntiX or ConnMan V Sailfish OS), standard commands won't work. Here's what to do in such cases:

For Wicd:

Passwords are stored in a file /etc/wicd/wireless-settings.conf. Open it:

sudo nano /etc/wicd/wireless-settings.conf

Look for blocks like:

[MyWiFi]

encryption = WPA2

key = s:your_password

For ConnMan:

Use the command:

connmanctl services

Then connect to the network and request settings:

connmanctl config <network_name> --passphrase

If none of these methods work, your distribution may use a unique network manager. Check its name with the following command:

ps aux | grep -E 'network|wifi|conn'
What should I do if my password is displayed as a hash?

If instead of a password you see a line like this psk=1234abcd5678..., which means it's encrypted. Recovering the original password from such a hash is virtually impossible. However, you can:

1. Connect to the router via Ethernet and change the password in the web interface (usually 192.168.0.1 or 192.168.1.1).

2. Reset the router to factory settings (button Reset on the back panel).

3. Use the utility wpa_passphraseto generate a new hash for the password you know and compare it with the saved one.

6. Method: if you are not an administrator (without sudo)

What to do if you don't have a license sudo, but need your password urgently? There are several workarounds:

  • 🔄 Try the command nmcli without sudo - sometimes it shows the current network password even without administrator rights:
    nmcli -g 802-11-wireless-security.psk connection show "$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d':' -f2)"
  • 📁 Check if the password is saved in ~/.config/ or ~/.local/share/ - some managers (for example, KWallet V KDE) store data in user folders.
  • 🖥️ If you are connected to the network via Ethernet, log in to the router's web interface (usually 192.168.0.1) and look for the password there. The login and password are often listed on the router's sticker.

If nothing helps, there are two options left:

  1. Ask the system administrator to run the command with sudo.
  2. Connect to the router via cable and reset the Wi-Fi password through the web interface.

Common mistakes and their solutions

When trying to view your password, you may encounter common problems. Here's how to solve them:

Error Cause Solution
Error: no secrets The password is not saved in the system (it was entered manually each time you connected). Check the password on your router or reset it.
Permission denied Insufficient permissions to read the file. Use sudo or ask the administrator.
Files in /etc/NetworkManager/ empty Your distribution uses a different network manager (for example, Wicd). Check section 5 of this article.
nmcli: command not found NetworkManager not installed. Install it: sudo apt install network-manager (Debian/Ubuntu) or sudo pacman -S networkmanager (Arch).

If you see the message Device 'wlp3s0' is not active, this means the Wi-Fi adapter is disabled. Enable it with the command:

sudo ip link set wlp3s0 up

(Replace wlp3s0 the name of your adapter - look it up with the command ip a.)

FAQ: Answers to frequently asked questions

Is it possible to find out the password for a Wi-Fi connection that another user connected to on the same PC?

Yes, if you have the rights sudo. Passwords are stored in system files (/etc/NetworkManager/), and any administrator can view them. Without sudo You will only see networks that you have connected to under your username.

I changed the password on my router, but Linux still connects with the old one. Why?

This means the system has saved the old password in the cache. Update it:

  1. Open your network settings and "forget" this network.
  2. Please reconnect using the new password.

Or run in terminal:

nmcli connection delete "NetworkName"
How do I view my Wi-Fi password on Linux if I'm connecting via WPS?

If you connected via WPS (button on the router), the password is not saved in the system. You will have to:

  • Or log into the router's web interface and see the password there.
  • Or reset the router and configure it again.
Do these methods work on Android or Windows?

No, these instructions are for Linux only. For Windows use netsh wlan show profile, and for Android You will need root rights and a file manager (passwords are stored in /data/misc/wifi/WifiConfigStore.xml).

Is it possible to export all Wi-Fi passwords to a file for backup?

Yes. Copy the entire config folder:

sudo cp -r /etc/NetworkManager/system-connections/ ~/wifi_backup/

To restore later:

sudo cp -r ~/wifi_backup/* /etc/NetworkManager/system-connections/

sudo chmod 600 /etc/NetworkManager/system-connections/*

sudo systemctl restart NetworkManager