nmcli connection add type wifi con-name 'office' ssid OfficeWiFi wifi-sec.key-mgmt wpa-psk wifi-sec.psk 'secret'

Category: Local Network & Public Hosting

nmcli connection add type wifi con-name 'office' ssid OfficeWiFi wifi-sec.key-mgmt wpa-psk wifi-sec.psk 'secret'

Create a saved Wi-Fi profile with WPA2 key

This registers a profile that knows the SSID OfficeWiFi and its WPA-PSK passphrase, so the machine can join that network without typing the password again. The wifi-sec.key-mgmt wpa-psk line declares the security mode and wifi-sec.psk carries the key. The profile stays dormant until activated, then autoconnects on future boots.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.