Fix NetworkManager Can't See Hidden SSID on Linux

Linux & Unix Beginner 👁 9 views 📅 Jun 29, 2026

Your Linux PC won't connect to a hidden Wi-Fi network? Here's how to add it manually in NetworkManager and make it stick.

Quick answer

Run nmcli device wifi connect 'YourHiddenSSID' password 'yourpassword' hidden yes — that's it.

Why this happens

Hidden networks don't broadcast their name (SSID) in beacon frames. NetworkManager on Linux has a quirk: when you try to connect to a hidden network through the GUI, it sometimes creates a connection profile but forgets to mark it as "hidden." The system then scans for visible networks, doesn't see the hidden one, and never tries to connect. I've seen this on Ubuntu 22.04 and Fedora 37 with both GNOME and KDE. The fix is simple once you know where to look.

Step-by-step fix

I'll give you two ways. The first uses the command line, which is faster. The second uses the GUI if you prefer clicking.

Method 1: Use nmcli (recommended)

  1. Open a terminal. On Ubuntu or Debian, press Ctrl+Alt+T. On Fedora, same or search for Terminal.

  2. Check your Wi-Fi interface name with:

    nmcli device status

    Look for the line where TYPE is wifi. The DEVICE column shows something like wlan0 or wlp2s0. Write that name down.

  3. Now run the connect command. Replace the parts in brackets:

    nmcli device wifi connect 'YourHiddenSSID' password 'YourPassword' hidden yes

    Use the exact SSID. Capital letters matter. The hidden yes part is what makes it work — it tells NetworkManager to send probe requests for this network even when the SSID isn't visible.

    After you press Enter, you should see: Device 'wlan0' successfully activated with 'your-uuid'.

  4. Verify the connection is saved:

    nmcli connection show

    Find your network name in the list. The TYPE should be wifi.

  5. Test it. Turn Wi-Fi off and on again, or reboot. The computer should connect automatically.

Method 2: Use the GUI (GNOME example)

  1. Open Settings, go to Wi-Fi. Click the three-dot menu or the gear icon next to the Wi-Fi toggle. Choose "Connect to Hidden Network."

    If you don't see that option, click the "+" button (Add Network).

  2. Enter the SSID exactly. Set Security to WPA2/WPA3 Personal (or whatever your router uses). Enter the password.

  3. Here's the part most people miss: after saving, go back to the Wi-Fi list. Find the network (it might show as "Disconnected"). Click the gear icon on that connection.

  4. Look for a checkbox that says "Connect automatically" — check it. Also look for "Hidden network" or "This network is hidden" — often it's not there in the GUI. That's why the CLI method is better: it sets the hidden flag correctly.

If the GUI method doesn't work, go back to Method 1. The CLI never lies.

Alternative fixes if the main one fails

Edit the connection file directly

If nmcli gives you an error like "Error: secrets were required, but not provided," the password might be missing. Edit the config file:

  1. Find the connection file:

    sudo ls /etc/NetworkManager/system-connections/

    You'll see a file named after your SSID or a UUID.

  2. Open it with root:

    sudo nano /etc/NetworkManager/system-connections/YourSSID.nmconnection
  3. Look for the [wifi] section. Add this line if it's not there:

    ssid-hint-masked=true

    This is the hidden flag. Also make sure mode=infrastructure is there.

    In the [wifi-security] section, check that psk= has your password. If it says psk-flags=1, remove that line and replace it with psk=yourpassword.

  4. Save the file (Ctrl+O, then Ctrl+X).

  5. Restart NetworkManager:

    sudo systemctl restart NetworkManager

Check if the router is actually broadcasting

Get a phone or another laptop and try to connect to the hidden network. If no device can see it, the router might be in "stealth mode" or simply off. Log into your router admin page and make sure the SSID broadcast is enabled — then check the "Enable Hidden Wireless" option if you want it hidden.

Prevention tip

Once you have the connection working, save the config file. Copy it somewhere safe:

sudo cp /etc/NetworkManager/system-connections/YourSSID.nmconnection ~/backup-ssid.nmconnection

If you reinstall Linux or move to a new computer, you can copy this file back to /etc/NetworkManager/system-connections/, run sudo chmod 600 on it, and restart NetworkManager. The connection will appear instantly.

Also: if you ever need to change the password later, don't use the GUI — it resets the hidden flag. Use nmcli connection modify YourSSID wifi-sec.psk newpassword instead.

Was this solution helpful?