View Saved Wi-Fi Passwords on Ubuntu

You can view previously connected Wi-Fi passwords by accessing the NetworkManager configuration files. Ubuntu stores every saved connection in plain text (the password is stored in the profile file, readable only with root) under /etc/NetworkManager/system-connections/ — and since the psk is stored in clear text, recovering a forgotten network key is just a matter of reading the right file.

Step-by-Step Guide

  1. List all saved Wi-Fi profiles:

    ls /etc/NetworkManager/system-connections/

    The output is one file per saved connection, e.g. MyWiFi.nmconnection.

  2. View the contents of a specific Wi-Fi profile:

    sudo cat "/etc/NetworkManager/system-connections/<WiFi-NAME>.nmconnection"

    Replace <WiFi-NAME> with the actual name of the Wi-Fi profile (file name).

  3. Locate the password: look for the line containing:

    psk=your_wifi_password

Alternative: Use nmcli

If your profile shows psk-flags=1 (password stored in the system keyring instead of the file), retrieve it with:

nmcli -s connection show <WiFi-NAME> | grep psk

-s (or --show-secrets) forces NetworkManager to print secret values; it may prompt for the keyring password.

Notes

Related Articles

A.M. Rinas

Written by A.M. Rinas

Full-Stack Software Engineer working on web applications, DevOps automation, and databases. More about me on the about page, or say hi through the contact page and LinkedIn.

← Back to all articles