{"id":3954,"date":"2022-12-20T17:28:30","date_gmt":"2022-12-20T20:28:30","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/user-session-keyring-man7\/"},"modified":"2022-12-20T17:28:30","modified_gmt":"2022-12-20T20:28:30","slug":"user-session-keyring-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/user-session-keyring-man7\/","title":{"rendered":"USER-SESSION-KEYRING (man7)"},"content":{"rendered":"<h1 align=\"center\">USER-SESSION-KEYRING<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#NOTES\">NOTES<\/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-session-keyring \u2212 per-user default session keyring<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The user session keyring is a keyring used to anchor keys on behalf of a user. Each UID the kernel deals with has its own user session keyring that is shared by all processes with that UID. The user session keyring has a name (description) of the form <i>_uid_ses.<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 session 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 session keyring, the <b>user\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\">The user session keyring is created on demand when a thread requests it or when a thread asks for its <b>session\u2212keyring<\/b>(7) and that keyring doesn\u2019t exist. In the latter case, a user session keyring will be created and, if the session keyring wasn\u2019t to be created, the user session keyring will be set as the process\u2019s actual session keyring.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The user session keyring is searched by <b>request_key<\/b>(2) if the actual session keyring does not exist and is ignored otherwise.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A special serial number value, <b>KEY_SPEC_USER_SESSION_KEYRING<\/b>, is defined that can be used in lieu of the actual serial number of the calling process\u2019s user session keyring.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">From the <b>keyctl<\/b>(1) utility, \u2019<b>@us<\/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 session 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 a user session keyring does not exist when it is accessed, it will be created.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Rather than relying on the user session keyring, it is strongly recommended\u2014especially if the process is running as root\u2014that a <b>session\u2212keyring<\/b>(7) be set explicitly, for example by <b>pam_keyinit<\/b>(8).<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The user session keyring was added to support situations where a process doesn\u2019t have a session keyring, perhaps because it was created via a pathway that didn\u2019t involve PAM (e.g., perhaps it was a daemon started by <b>inetd<\/b>(8)). In such a scenario, the user session keyring acts as a substitute for the <b>session\u2212keyring<\/b>(7).<\/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\u2212keyring<\/b>(7)<\/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-session-keyring \u2212 per-user default session 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,1045],"class_list":["post-3954","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-user-session-keyring"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3954","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=3954"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3954\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}