How to connect to hidden wifi network using nmcli How to connect to hidden wifi network using nmcli linux linux

How to connect to hidden wifi network using nmcli


Okay, I have the solution. We know the ssid and the password.

nmcli c add type wifi con-name <connect name> ifname wlan0 ssid <ssid>nmcli con modify <connect name> wifi-sec.key-mgmt wpa-psknmcli con modify <connect name> wifi-sec.psk <password>nmcli con up <connect name>

If we dont need the connection anymore:

nmcli c delete <connect name>


This works fine for me:

nmcli dev wifi connect "abc" password 123 hidden yes


While doing some experimenting, I found that you can use both echnotux's and Pocokman's answers to get it to connect. i.e

nmcli c add type wifi con-name <connect name> ifname wlan0 ssid <ssid>nmcli dev wifi connect <ssid> password <password> hidden yesnmcli c delete <connect name>

This simplifies it quite a bit.