1user-keyring(7) Miscellaneous Information Manual user-keyring(7)
2
3
4
6 user-keyring - per-user keyring
7
9 The user keyring is a keyring used to anchor keys on behalf of a user.
10 Each UID the kernel deals with has its own user keyring that is shared
11 by all processes with that UID. The user keyring has a name (descrip‐
12 tion) of the form _uid.<UID> where <UID> is the user ID of the corre‐
13 sponding user.
14
15 The user keyring is associated with the record that the kernel main‐
16 tains for the UID. It comes into existence upon the first attempt to
17 access either the user keyring, the user-session-keyring(7), or the
18 session-keyring(7). The keyring remains pinned in existence so long as
19 there are processes running with that real UID or files opened by those
20 processes remain open. (The keyring can also be pinned indefinitely by
21 linking it into another keyring.)
22
23 Typically, the user keyring is created by pam_keyinit(8) when a user
24 logs in.
25
26 The user keyring is not searched by default by request_key(2). When
27 pam_keyinit(8) creates a session keyring, it adds to it a link to the
28 user keyring so that the user keyring will be searched when the session
29 keyring is.
30
31 A special serial number value, KEY_SPEC_USER_KEYRING, is defined that
32 can be used in lieu of the actual serial number of the calling
33 process's user keyring.
34
35 From the keyctl(1) utility, '@u' can be used instead of a numeric key
36 ID in much the same way.
37
38 User keyrings are independent of clone(2), fork(2), vfork(2), ex‐
39 ecve(2), and _exit(2) excepting that the keyring is destroyed when the
40 UID record is destroyed when the last process pinning it exits.
41
42 If it is necessary for a key associated with a user to exist beyond the
43 UID record being garbage collected—for example, for use by a cron(8)
44 script—then the persistent-keyring(7) should be used instead.
45
46 If a user keyring does not exist when it is accessed, it will be cre‐
47 ated.
48
50 keyctl(1), keyctl(3), keyrings(7), persistent-keyring(7),
51 process-keyring(7), session-keyring(7), thread-keyring(7),
52 user-session-keyring(7), pam_keyinit(8)
53
54
55
56Linux man-pages 6.04 2023-02-05 user-keyring(7)