{"id":3983,"date":"2022-12-20T17:28:36","date_gmt":"2022-12-20T20:28:36","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/session-keyring-man7\/"},"modified":"2022-12-20T17:28:36","modified_gmt":"2022-12-20T20:28:36","slug":"session-keyring-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/session-keyring-man7\/","title":{"rendered":"SESSION-KEYRING (man7)"},"content":{"rendered":"<h1 align=\"center\">SESSION-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\">session-keyring \u2212 session shared process keyring<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The session keyring is a keyring used to anchor keys on behalf of a process. It is typically created by <b>pam_keyinit<\/b>(8) when a user logs in and a link will be added that refers to the <b>user\u2212keyring<\/b>(7). Optionally, PAM may revoke the session keyring on logout. (In typical configurations, PAM does do this revocation.) The session keyring has the name (description) <i>_ses<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A special serial number value, <b>KEY_SPEC_SESSION_KEYRING<\/b>, is defined that can be used in lieu of the actual serial number of the calling process\u2019s session keyring.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">From the <b>keyctl<\/b>(1) utility, \u2019<b>@s<\/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\">A process\u2019s session keyring is inherited across <b>clone<\/b>(2), <b>fork<\/b>(2), and <b>vfork<\/b>(2). The session keyring is preserved across <b>execve<\/b>(2), even when the executable is set-user-ID or set-group-ID or has capabilities. The session keyring is destroyed when the last process that refers to it exits.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If a process doesn\u2019t have a session keyring when it is accessed, then, under certain circumstances, the <b>user\u2212session\u2212keyring<\/b>(7) will be attached as the session keyring and under others a new session keyring will be created. (See <b>user\u2212session\u2212keyring<\/b>(7) for further details.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Special operations<\/b> <br \/> The <i>keyutils<\/i> library provides the following special operations for manipulating session keyrings: <b><br \/> keyctl_join_session_keyring<\/b>(3)<\/p>\n<p style=\"margin-left:22%;\">This operation allows the caller to change the session keyring that it subscribes to. The caller can join an existing keyring with a specified name (description), create a new keyring with a given name, or ask the kernel to create a new &#8220;anonymous&#8221; session keyring with the name &#8220;_ses&#8221;. (This function is an interface to the <b>keyctl<\/b>(2) <b>KEYCTL_JOIN_SESSION_KEYRING<\/b> operation.)<\/p>\n<p style=\"margin-left:11%;\"><b>keyctl_session_to_parent<\/b>(3)<\/p>\n<p style=\"margin-left:22%;\">This operation allows the caller to make the parent process\u2019s session keyring to the same as its own. For this to succeed, the parent process must have identical security attributes and must be single threaded. (This function is an interface to the <b>keyctl<\/b>(2) <b>KEYCTL_SESSION_TO_PARENT<\/b> operation.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">These operations are also exposed through the <b>keyctl<\/b>(1) utility as:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">keyctl session <br \/> keyctl session &#8211; [<prog> <arg1> <arg2> &#8230;] <br \/> keyctl session <name> [<prog> <arg1> <arg2> &#8230;]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">and:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">keyctl new_session<\/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>keyctl_join_session_keyring<\/b>(3), <b>keyctl_session_to_parent<\/b>(3), <b>keyrings<\/b>(7), <b>persistent\u2212keyring<\/b>(7), <b>process\u2212keyring<\/b>(7), <b>thread\u2212keyring<\/b>(7), <b>user\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>  session-keyring \u2212 session shared process 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,1072],"class_list":["post-3983","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-session-keyring"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3983","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=3983"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3983\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}