PAM_GNOME_KEYRING(8)

πŸ“¦ version 48.0, in opensuse-leap 16.0

πŸ’… pam_gnome_keyring β€” ok bestie, let me tell you about the Gnome Keyring PAM module

So this is pam_gnome_keyring, a page from the Gnome Keyring PAM Module Manua (that's the manual name, not a typo, it's just how it's spelled there 🫢). It's a PAM module, it's in section 8, and it's about unlocking your Gnome Keyring automatically so you don't have to type your password a million times. Iconic behavior, honestly.


✨ NAME ✨

pam_gnome_keyring β€” automatic unlocking of Gnome Keyring. That's it, that's the whole vibe. πŸ”‘


πŸŽ€ SYNOPSIS πŸŽ€

pam_gnome_keyring.so

Yep. That's the whole invocation. You just drop that name into your PAM config and the magic happens. No arguments required at the top level, no flags on the module line itself β€” the options go after it, and we'll get to those. πŸ’…


🌸 DESCRIPTION 🌸

Okay so here's the tea β˜• β€” the Gnome Keyring service module for PAM is a triple threat. It handles three PAM categories:

  • authentication (module-type parameter: auth)
  • session management (module-type parameter: session)
  • password management (module-type parameter: password)

Three whole personalities, one module. Main character energy fr fr. Let's break each one down. πŸ¦‹

πŸ” Authentication Module

The Gnome Keyring authentication module snags the password that a previous module already got in the PAM stack, and tucks it away for later use. Cute, right? πŸŽ€

But listen β€” when no password was obtained, this module literally does nothing and returns success. It will never prompt for a password by itself. Never ever. Not its job, not its problem.

Unless otherwise noted, this module returns success. Say it with me: success is the default. ✨

Here are the options you can pass to the authentication module:

  • auto_start β€” the Gnome Keyring daemon gets started if it's not already running, and the login keyring gets unlocked using the password you provided. But if any of that fails, this module returns an error. No pressure or anything. 😭
  • *only_if=service* β€” a comma separated list of services (like gdm,xdm) that this module will actually handle. If your service isn't on the list, the module returns success without doing anything. Basically a VIP list. πŸ’…

🌈 Session Management Module

The session management module is all about starting and ending sessions β€” the open and the close, the hello and the bye. πŸ‘‹

Here's how it goes: if the Gnome Keyring daemon isn't running, or no password was stored by the authentication module, this module returns success and we move on. Otherwise? It'll try to unlock the login keyring, and if the unlocking fails, this module returns an error. 😬

And when the session is terminated, if the daemon was started in either module, then that daemon gets terminated too. Clean exits only, bestie. ✨

Options for the session management module:

  • auto_start β€” same as in authentication. But heads up: either the authentication or the session management module must have the auto_start option for the Gnome Keyring daemon to actually get started. Pick one, pick both, just don't pick neither. πŸ™ˆ
  • *only_if=service* β€” list of services to handle. Same VIP-list situation as above. 🎟️

πŸ”‘ Password Management Module

The password module is the one that lets you change the password for the login keyring. Very glow-up of it. πŸ’–

Rules of the game:

  • If no old password was obtained by a previous module in the stack, this module is just ignored. Not today. πŸ’€
  • On the flip side, when no new password was obtained, this module will prompt for one. It's gotta have it.

The Gnome Keyring daemon gets started if it's not already running β€” and it gets stopped after concluding the operation if it wasn't running before. Tidy! 🧹

Options for the password management module:

  • auto_start β€” keep the daemon running even when it was started by this module. You started it, but it stays. Queen behavior. πŸ‘‘
  • *only_if=service* β€” list of services to handle. Yes, again. Consistency is key. πŸ—οΈ
  • use_authtok β€” do not prompt for a new password. And if it's not provided? Return error. That's the deal, no negotiation. 🚨

πŸ—‚οΈ FILES πŸ—‚οΈ

  • $HOME/.local/share/keyrings/login.keyring β€” the encrypted login keyring. That's the little vault. πŸ’œ

🧚 EXAMPLES 🧚

Okay, practical time, because this is where it all clicks. 🀩

Here's the example of the file /etc/pam.d/gdm, which configures the gdm service to use standard UNIX authentication plus start and unlock Gnome Keyring. The rest of the configuration is inherited from the login service configuration. Slay, inheritance.

auth       required     pam_unix.so
auth       optional     pam_gnome_keyring.so
account    include      login
session    include      login
session    optional     pam_gnome_keyring.so auto_start
password   include      login

And here's the example of the file /etc/pam.d/passwd, which configures the passwd program to update the keyring password right along with the user's system password. Two birds, one password change. 🐦🐦

password   required     pam_unix.so
password   optional     pam_gnome_keyring.so

⚠️ NOTES ⚠️

Real talk, bestie β€” Gnome Keyring implements its own SSH agent, so you should not stack it with pam_ssh for session management. Just don't. They would fight. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

pam.conf(5), pam.d(5), pam(8), auditctl(8), auditd(8) β€” go read those too, expanding your knowledge is always a vibe. πŸ“šβœ¨


πŸ’Œ AUTHOR πŸ’Œ

pam_gnome_keyring was written by Stef Walter <stef@thewalter.net>. Legend behavior. πŸ‘‘πŸŒΈ


Okay that's the whole page, you made it!! πŸŽ‰ This was the Gnome Keyring PAM Module Manua, PAM_GNOME_KEYRING(8), and it's giving "your keyring unlocks itself now" energy. Go forth and never type that password twice. πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from