{"id":3896,"date":"2022-12-20T17:28:21","date_gmt":"2022-12-20T20:28:21","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/user-keyring-man7\/"},"modified":"2022-12-20T17:28:21","modified_gmt":"2022-12-20T20:28:21","slug":"user-keyring-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/user-keyring-man7\/","title":{"rendered":"USER-KEYRING (man7)"},"content":{"rendered":"<h1 align=\"center\">USER-KEYRING<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">user-keyring \u2212 per-user keyring<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The user keyring is a keyring used to anchor keys on behalf of a user. Each UID the kernel deals with has its own user keyring that is shared by all processes with that UID. The user keyring has a name (description) of the form <i>_uid.<UID><\/i> where <i><UID><\/i> is the user ID of the corresponding user.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The user keyring is associated with the record that the kernel maintains for the UID. It comes into existence upon the first attempt to access either the user keyring, the <b>user\u2212session\u2212keyring<\/b>(7), or the <b>session\u2212keyring<\/b>(7). The keyring remains pinned in existence so long as there are processes running with that real UID or files opened by those processes remain open. (The keyring can also be pinned indefinitely by linking it into another keyring.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Typically, the user keyring is created by <b>pam_keyinit<\/b>(8) when a user logs in.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The user keyring is not searched by default by <b>request_key<\/b>(2). When <b>pam_keyinit<\/b>(8) creates a session keyring, it adds to it a link to the user keyring so that the user keyring will be searched when the session keyring is.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A special serial number value, <b>KEY_SPEC_USER_KEYRING<\/b>, is defined that can be used in lieu of the actual serial number of the calling process\u2019s user keyring.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">From the <b>keyctl<\/b>(1) utility, \u2019<b>@u<\/b>\u2019 can be used instead of a numeric key ID in much the same way.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">User keyrings are independent of <b>clone<\/b>(2), <b>fork<\/b>(2), <b>vfork<\/b>(2), <b>execve<\/b>(2), and <b>_exit<\/b>(2) excepting that the keyring is destroyed when the UID record is destroyed when the last process pinning it exits.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If it is necessary for a key associated with a user to exist beyond the UID record being garbage collected\u2014for example, for use by a <b>cron<\/b>(8) script\u2014then the <b>persistent\u2212keyring<\/b>(7) should be used instead.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If a user keyring does not exist when it is accessed, it will be created.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>keyctl<\/b>(1), <b>keyctl<\/b>(3), <b>keyrings<\/b>(7), <b>persistent\u2212keyring<\/b>(7), <b>process\u2212keyring<\/b>(7), <b>session\u2212keyring<\/b>(7), <b>thread\u2212keyring<\/b>(7), <b>user\u2212session\u2212keyring<\/b>(7), <b>pam_keyinit<\/b>(8)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  user-keyring \u2212 per-user keyring <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,972,990],"class_list":["post-3896","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-user-keyring"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3896"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3896\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}