Get Network Manager to stop asking you for the keyring password with pam_keyring

As I’m using network manager to control wireless access on my laptop and a desktop computer in my home, I’ve decided that the keyring manager is a nuisance.

I couldn’t bear for it to constantly ask for a password every time that I needed to log on to a wireless network to retrieve the stored password. This is further compounded by the inevitable question: “Why do I have to enter my password again?”

Over at the Ubuntu forums the same question has been asked. Thankfully, there is a resolve that will also be included in the Feisty release.

The easiest way for Ubuntu user is to download the .deb package of pam_keyring and install on your system.

Once installed, so the following:

  • Open a terminal window
  • Type cd /etc/pam.d
  • Type sudo gedit gdm
  • In the editor, and the following:
    ## Added so that NetworkManager doesn't keep asking for Keyring password.
    ## relies on having same password to keyring as login password.
    auth optional pam_keyring.so try_first_pass
    session optional pam_keyring.so

Save the file, and then try it out.

The catch is that the keyring manager must match your login password. If you have a different password set already, then the only way to make pam_keyring work is to delete your existing keyring and restart:
killall gnome-keyring-daemon
rm ~/.gnome2/keyrings/*
gnome-keyring-daemon

or alternatively change your login password to match your keyring.

Once you have entered the network key of the wireless LAN, you should find that passwords and automatically stored and retrieved.

And this works for any other Gnome applications that use the keyring too.