Besides the answer provided earlier I was going for a different direction and after some research created another answer.
After creating wi-fi connection the next step would be to edit the keyfile corresponding to it. With root permissions, edit the keyfile which is located in
Within [wifi-security] section add the psk flag below your password:
It is added to make sure the password maintain non visible. Now, the connection's properties cannot be changed without typing the password. The drawback is that Network Manager must be restarted in case you want to disconnect/connect again, otherwise you will have to type in password each time. For that we can use a script, but note you must uncheck autoconnect option with this method. Open text editor and paste following:
if [ "$2" = "down" ];then
case "$CONNECTION_UUID" in
service network-manager restart;;
Replace UUID from script with the one from your connection (or pipe several for multiple connections). It can be retrieved with
nmcli connection show command. Save the script to your home folder and name it restart_wireless. Then move it to
sudo mv '~/restart_wireless' /etc/NetworkManager/dispatcher.d
and change permissions:
sudo chmod 755 '/etc/NetworkManager/dispatcher.d/restart_wireless'
At this point you might experience password being visible after logout/login. It is due to default keyring setting. To prevent this you might add new item to Startup Applications:
/usr/bin/gnome-keyring-daemon --replace --components=secrets
and all pass-phrases will be flushed each time you login. Do this only if you don't have other applications corresponding to your keyring settings.
Restart for effect.
After this procedure Wi-Fi password is not shown in Network Connections:
password cannot be accessed with command line tools
there is no need to alter GNOME Keyring settings
ability to use Network connections GUI
ability to use Wi-fi connection within Guest session
(although it might be interesting to reproduce those restrictions as well)
- cannot use 'Automatically connect to this network when is available' option
- passwords will be flushed each time on login