user-keyring(7)

๐Ÿ’– user-keyring(7) ๐Ÿ’–

okay bestie, so this is a page from the Miscellaneous Information Manual, section 7 โ€” user-keyring(7). it's giving "the keyring that belongs to you", and honestly? iconic. let's get into it ๐Ÿซถ

โœจ NAME โœจ

user-keyring โ€” the per-user keyring, aka your very own keyring, no cap ๐Ÿ’…

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so the user keyring is, like, a keyring whose whole job is to anchor keys on behalf of a user. every single UID the kernel deals with gets its own user keyring, and that keyring is shared by all the processes that have that UID. yes, all of them. they're passing the aux cord around. ๐ŸŽ€

the user keyring has a name (we call it a description around here) shaped like this: _uid.<UID> โ€” where <UID> is the user ID of the corresponding user. that's it, that's the naming scheme, she's simple and she's correct โœจ

here's the tea on how she comes into existence: the user keyring is tied to the record the kernel keeps for that UID. it pops into existence the first time anything tries to access either the user keyring, the user-session-keyring(7), or the session-keyring(7). and once she's here, the keyring stays pinned in existence for as long as there are processes running with that real UID, or files opened by those processes are still open. (also, you can pin it indefinitely by linking it into another keyring โ€” main character energy, she refuses to leave ๐Ÿซถ)

typically, the user keyring gets created by pam_keyinit(8) when a user logs in. slay.

big important thing bestie: the user keyring is not searched by default by request_key(2). when pam_keyinit(8) creates a session keyring, it adds a link to the user keyring inside it, so that the user keyring does get searched when the session keyring is searched. so like, she's not out here getting noticed on her own โ€” she gets noticed through her friend ๐Ÿ˜ญ

there's a special serial number value, KEY_SPEC_USER_KEYRING, defined so you can use it in lieu of the actual serial number of the calling process's user keyring. very convenient, we love a shortcut โœจ

and from the keyctl(1) utility, you can use '@u' instead of a numeric key ID in much the same way. yes queen, abbreviated ๐Ÿ’…

user keyrings are independent of clone(2), fork(2), vfork(2), execve(2), and _exit(3) โ€” the only exception being that the keyring gets destroyed when the UID record is destroyed, which happens when the last process pinning it exits. so like, she's not affected by your forking and exec-ing, she's just out here existing, but when the last one leaves the party, she's gone ๐Ÿ’€

if it's necessary for a key associated with a user to exist beyond the UID record being garbage collected โ€” for example, for use by a cron(8) script โ€” then you should use the persistent-keyring(7) instead. do not come for the user keyring for that, she is not the one, periodt.

oh and one more: if a user keyring does not exist when it is accessed, it will be created. she materializes. she is always available ๐Ÿฆ‹


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


and that's the whole vibe bestie ๐Ÿ’œ this was brought to you by Linux man-pages 6.20, dated 2026-06-05 โ€” go forth and know your keyrings, i'm obsessed with you ๐ŸŒˆโญ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-2.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms