Connecting to a Hidden Wi-Fi Network in Ubuntu: 3 Proven Methods

Hidden Wi-Fi networks (with SSID Broadcast disabled) are often used for increased security—their names are not displayed in the public list of available networks. However, connecting to such networks Ubuntu Requires manual data entry, which can be challenging for beginners. In this article, we'll cover all the current connection methods: via a graphical interface NetworkManager, command line nmcli and editing configuration files.

We will pay special attention to typical mistakes: why Ubuntu Hidden network settings may not save, how to fix authentication issues WPA2-Enterprise, and what to do if the connection is lost after a reboot. All instructions have been tested on Ubuntu 22.04 LTS And 20.04 LTS, but will also work for other distributions based on Debian (For example, Linux Mint or Pop!_OS).

📊 Which Wi-Fi connection method do you use most often?
Through the graphical interface
Via terminal (nmcli)
I edit configs manually
I use scripts
I don't know what this is

1. Connection via graphical interface (GUI)

The easiest method is to use the built-in NetworkManagerIt's suitable for most users unfamiliar with the command line. Here are the step-by-step instructions:

  1. Open the networks menu: Click on the Wi-Fi icon in the upper right corner of the panel GNOME (or KDE, if you use Kubuntu).
  2. Select "Connect to a hidden network": This item appears at the bottom of the list of available networks.
  3. Enter network details:
    • 📡 Network name (SSID): the exact name of the hidden network (case sensitive!)
    • 🔒 Security type: usually WPA & WPA2 Personal or WPA3 Personal
    • 🔑 Password: security key (minimum length is 8 characters)
  • Save the settings: Check the "Connect automatically" box if you want to avoid manual entry every time you reboot.
  • If the Internet doesn't work after connecting, check your settings. IPv4/IPv6 in the "IP Settings" section (it should be "Automatic (DHCP)" for most routers).

    Make sure you entered the SSID correctly|Check the case of the letters in the network name|Check the security type with your network administrator|Disable your VPN if it is active|Restart your router if you are having connection issues-->

    2. Connecting via terminal (nmcli)

    Utility nmcli — a powerful tool for managing networks in UbuntuThis is useful if a graphical interface is unavailable (for example, on a server without a GUI) or automation is required. Here's the command to connect to a hidden network:

    nmcli dev wifi connect "NETWORK_NAME" password "PASSWORD" hidden yes

    Let's look at the parameters:

    • 🔹 dev wifi — indicates that we are working with a Wi-Fi device.
    • 🔹 connect — command to connect.
    • 🔹 hidden yes — mandatory flag for hidden networks.
    • 🔹 password — network password (if the network has no password, this parameter is not needed).

    To check if the connection is successful, use:

    nmcli connection show

    If your connection appears in the output with the status activated, then everything went well. To disable:

    nmcli connection down "NETWORK_NAME"

    3. Manually editing the configuration file

    For advanced users or specific settings (eg. WPA2-Enterprise) You may need to edit the configuration file manually. Open a terminal and run:

    sudo nano /etc/NetworkManager/system-connections/HIDDEN_NETWORK.nmconnection

    Add the following template (replace the values ​​with your own):

    [connection]
    

    id=HIDDEN_NETWORK

    type=wifi

    permissions=

    [wifi]

    hidden=true

    ssid=NETWORK_NAME

    [wifi-security]

    key-mgmt=wpa-psk

    psk=PASSWORD

    [ipv4]

    method=auto

    [ipv6]

    method=auto

    Save the file (Ctrl+O, then Enter) and reboot NetworkManager:

    sudo systemctl restart NetworkManager
    What should I do if the network does not connect after editing the file?

    Check file permissions: sudo chmod 600 /etc/NetworkManager/system-connections/HIDDEN_NETWORK.nmconnection. Also, make sure there are no extra spaces or tabs in the file - NetworkManager is syntax sensitive. If you use WPA2-Enterprise, add a section [802-1x] with authentication parameters (e.g. eap=peap, identity=your_login).

    4. Solving common problems

    Even after proper configuration, connecting to a hidden network may be unstable. Here are common errors and their solutions:

    Problem Possible cause Solution
    The network connects, but there is no internet Incorrect settings DNS or IP Check it out resolv.conf or specify Google DNS (8.8.8.8) manually
    Constant connection breaks Weak signal or interference on the channel Change the channel on your router (for example, from auto on 6 or 11)
    Authentication error Incorrect password or security type Check the settings on your router (for example, WPA2-PSK vs WPA3-SAE)
    Network is not saved after reboot You do not have permission to access the configuration file. Do it sudo chmod 600 /etc/NetworkManager/...

    5. Connecting to a hidden network with WPA2-Enterprise

    Corporate networks often use WPA2-Enterprise with authentication by PEAP or TTLSTo connect via nmcli use the command:

    nmcli connection add type wifi con-name "ENTERPRISE_NETWORK" ifname wlp3s0 ssid "NETWORK_NAME" -- wifi-sec.key-mgmt wpa-eap 802-1x.eap peap 802-1x.phase2-auth mschapv2 802-1x.identity "YOUR_LOGIN" 802-1x.password "YOUR_PASSWORD" 802-1x.ca-cert /path/to/certificate.crt

    Where:

    • 🔹 wlp3s0 — the name of your Wi-Fi adapter (check via ip a).
    • 🔹 peap — authentication method (can be ttls or tls).
    • 🔹 mschapv2 — phase 2 authentication.
    • 🔹 ca-cert — path to the root certificate (if required).

    For the graphical interface, in the network settings, select:

    1. Security type: WPA & WPA2 Enterprise.
    2. Authentication Method: Protected EAP (PEAP).
    3. Authentication: MSCHAPv2.
    4. Enter your login/password and upload a certificate if necessary.
    ⚠️ Attention: If the network uses EAP-TLS, you'll need to install a client certificate and private key. Without them, connection will be impossible.

    6. Automate connection at system boot

    To Ubuntu To connect to a hidden network automatically at startup, run:

    1. Check that the "Connect automatically" checkbox (for GUI) or the parameter is checked in the connection settings autoconnect=true in the file .nmconnection.
    2. Make sure that NetworkManager runs at startup:
    sudo systemctl enable NetworkManager

    If you use systemd-networkd instead of NetworkManager, create a file:

    sudo nano /etc/systemd/network/25-wireless.network

    With contents:

    [Match]
    

    Name=wlp3s0

    [Network]

    DHCP=yes

    [Route]

    Destination=0.0.0.0/0

    Gateway=192.168.1.1 # Replace with your gateway

    [DHCP]

    UseDNS=true

    Then activate the configuration:

    sudo systemctl restart systemd-networkd

    7. Checking the signal strength and choosing the optimal channel

    A weak signal is a common cause of problems with hidden networks. To check your signal strength, use:

    nmcli dev wifi list

    Or a more detailed utility iwconfig:

    iwconfig wlp3s0

    Pay attention to the parameter Signal level:

    • 📶 From -30 dBm to -50 dBm: excellent signal.
    • 📶 From -50 dBm to -70 dBm: average (breaks are possible).
    • 📶 Below -70 dBm: weak (it is recommended to move closer to the router).

    If the signal is weak, try:

    • 🔄 Change the channel on the router (for example, from 2.4 GHz on 5 GHz, if supported).
    • 📡 Use an external antenna or repeater.
    • 🔌 Connect via cable (if possible).
    ⚠️ Attention: On the channels 5 GHz Hidden networks may be less easily detected due to the specific operating conditions of some Wi-Fi adapter drivers (for example, Realtek RTL8821CE). In this case, try explicitly specifying the channel in the router settings.

    8. Alternative methods: wpa_supplicant

    If NetworkManager does not work (for example, on minimal server installations) Ubuntu Server), use wpa_supplicant. Edit the file:

    sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

    Add a block for the hidden network:

    network={
    

    ssid="NETWORK_NAME"

    scan_ssid=1

    psk="PASSWORD"

    key_mgmt=WPA-PSK

    }

    Launch wpa_supplicant manually:

    sudo wpa_supplicant -B -i wlp3s0 -c /etc/wpa_supplicant/wpa_supplicant.conf

    Then get the IP address:

    sudo dhclient wlp3s0

    To automatically start at boot, add to /etc/rc.local (before the line exit 0):

    wpa_supplicant -B -i wlp3s0 -c /etc/wpa_supplicant/wpa_supplicant.conf
    

    dhclient wlp3s0

    FAQ: Frequently Asked Questions

    Is it possible to connect to a hidden network without knowing its name (SSID)?

    No. To connect to a hidden network, you must know its exact address. SSID (name). If you don't know the name, try scanning the airwaves with a utility. airodump-ng (from the package aircrack-ng), but this requires administrator rights and may violate network usage rules.

    Why doesn't Ubuntu save the hidden network password after reboot?

    This is related to the permissions of the configuration file. Correct it with the command:

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

    Also check that the file contains the line permissions= (no meanings).

    How to connect to a hidden network with WPA3?

    Ubuntu 22.04 supports WPA3 out of the box. In nmcli use:

    nmcli dev wifi connect "NETWORK_NAME" password "PASSWORD" hidden yes wifi-sec.key-mgmt sae

    For Ubuntu 20.04 an update may be required wpa_supplicant up to version 2.9+.

    Is it possible to make a hidden network visible temporarily to make it easier to connect?

    Yes. Go to your router settings (usually at 192.168.1.1 or 192.168.0.1) and enable the option Enable SSID BroadcastAfter connecting all devices, disconnect it back.

    How can I verify that connecting to a hidden network is truly more secure?

    Hiding SSID does not provide real security - experienced users can detect the network using traffic analyzers (eg Wireshark). For protection, use:

    • 🔐 WPA3 instead of WPA2.
    • 🔄 Regularly change your password.
    • 🛡️ Filter by MAC-addresses (although this is not a panacea either).