When I connect to a wifi network automatically or by choosing it with nm-applet, and assuming I've successfully connected with WPA2 previously, the connection is fine.
If I connect by typing nmcli device wifi connect network-name
, then I'm asked for the password (via nm's dialog popup box), at which point the connection succeeds.
Is there a way I can tell nmcli about the secrets that nm-applet clearly knows?
[This concerns ubuntu 17.04 but appears to be the case since ubuntu 16.04 at least.]
Use
nmcli con up network-name
.The command
nmcli device wifi connect network-name
tries to create a connection, rather than using the stored data for the old one.