Save passwords in NetworkManager

Jose Lopes
Sun, 09 Feb 2014 00:00:00 +0000

desktop or laptop, NetworkManager is a good choice, even if you are not using KDE as a desktop environment or window manager.

Given that NetworkManager is a service, the program runs as a daemon. As a result, you might want to run the client application as well, which is "nm-applet". This applet will create an application in your desktop environment tray, which you can use to control which networks to connect to and also manage network connections in general, including VPN.

Unfortunately, I haven't found a simple way from within the applet to create system-wide connections, that is connections that are available to all users, while asking NetworkManager to save the network key, such as, a WEP or WPA-PSK key. The only way I have found is to execute the "nm-connection-editor" with "root" permissions, as follows

$ sudo nm-connection-editor

By executing the connection editor with "root" permissions, the NetworkManager applet is able to write to the NetworkManager configuration directory, namely, "/etc/NetworkManager", and in particular to the system connections directory, namely, "/etc/NetworkManager/system-connections".

An alternative to executing the connection editor with "root" permissions, is to simply edit manually the files contained in this directory, and in particular the section containing security information. For example, for a standard wireless network, the section might look like the following.

[802-11-wireless-security]
key-mgmt=<Your key management system, such as, WEP, WPA, etc>
psk=<Your private key unencrypted>