# user-keyring - per-user keyring - man(7) - [phpMan]

[_user-keyring_(7)](https://www.chedong.com/phpMan.php/man/user-keyring/7/markdown)                   Miscellaneous Information Manual                   [_user-keyring_(7)](https://www.chedong.com/phpMan.php/man/user-keyring/7/markdown)

## NAME
       user-keyring - per-user keyring

## DESCRIPTION
       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 __uid.<UID>_ where _<UID>_ is the user ID of the
       corresponding user.

       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 **user-ses‐**
       [**sion-keyring**(7)](https://www.chedong.com/phpMan.php/man/sion-keyring/7/markdown), or the [**session-keyring**(7)](https://www.chedong.com/phpMan.php/man/session-keyring/7/markdown).  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.)

       Typically, the user keyring is created by [**pam_keyinit**(8)](https://www.chedong.com/phpMan.php/man/pamkeyinit/8/markdown) when a user logs in.

       The user keyring is not searched by default by [**request_key**(2)](https://www.chedong.com/phpMan.php/man/requestkey/2/markdown).  When [**pam_keyinit**(8)](https://www.chedong.com/phpMan.php/man/pamkeyinit/8/markdown) 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.

       A  special serial number value, **KEY_SPEC_USER_KEYRING**, is defined that can be used in lieu of
       the actual serial number of the calling process's user keyring.

       From the [**keyctl**(1)](https://www.chedong.com/phpMan.php/man/keyctl/1/markdown) utility, '**@u**' can be used instead of a numeric key ID  in  much  the  same
       way.

       User keyrings are independent of [**clone**(2)](https://www.chedong.com/phpMan.php/man/clone/2/markdown), [**fork**(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown), [**vfork**(2)](https://www.chedong.com/phpMan.php/man/vfork/2/markdown), [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown), and [**_exit**(2)](https://www.chedong.com/phpMan.php/man/exit/2/markdown) except‐
       ing that the keyring is destroyed when the UID record is destroyed when the last process pin‐
       ning it exits.

       If  it  is  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)](https://www.chedong.com/phpMan.php/man/cron/8/markdown)  script—then  the  [**persistent-keyring**(7)](https://www.chedong.com/phpMan.php/man/persistent-keyring/7/markdown)
       should be used instead.

       If a user keyring does not exist when it is accessed, it will be created.

## SEE ALSO
       [**keyctl**(1)](https://www.chedong.com/phpMan.php/man/keyctl/1/markdown), [**keyctl**(3)](https://www.chedong.com/phpMan.php/man/keyctl/3/markdown), [**keyrings**(7)](https://www.chedong.com/phpMan.php/man/keyrings/7/markdown), [**persistent-keyring**(7)](https://www.chedong.com/phpMan.php/man/persistent-keyring/7/markdown), [**process-keyring**(7)](https://www.chedong.com/phpMan.php/man/process-keyring/7/markdown),
       [**session-keyring**(7)](https://www.chedong.com/phpMan.php/man/session-keyring/7/markdown), [**thread-keyring**(7)](https://www.chedong.com/phpMan.php/man/thread-keyring/7/markdown), [**user-session-keyring**(7)](https://www.chedong.com/phpMan.php/man/user-session-keyring/7/markdown), [**pam_keyinit**(8)](https://www.chedong.com/phpMan.php/man/pamkeyinit/8/markdown)

Linux man-pages 6.7                          2023-10-31                              [_user-keyring_(7)](https://www.chedong.com/phpMan.php/man/user-keyring/7/markdown)
