printf.3: Rework '
[man-pages.git] / man / man7 / user-keyring.7
blob77c4bb0a9d04d8b30db203510a775e1213638e76
1 .\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
2 .\" Written by David Howells (dhowells@redhat.com)
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .TH user-keyring 7 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 user-keyring \- per-user keyring
9 .SH DESCRIPTION
10 The user keyring is a keyring used to anchor keys on behalf of a user.
11 Each UID the kernel deals with has its own user keyring that
12 is shared by all processes with that UID.
13 The user keyring has a name (description) of the form
14 .I _uid.<UID>
15 where
16 .I <UID>
17 is the user ID of the corresponding user.
19 The user keyring is associated with the record that the kernel maintains
20 for the UID.
21 It comes into existence upon the first attempt to access either the
22 user keyring, the
23 .BR user\-session\-keyring (7),
24 or the
25 .BR session\-keyring (7).
26 The keyring remains pinned in existence so long as there are processes
27 running with that real UID or files opened by those processes remain open.
28 (The keyring can also be pinned indefinitely by linking it
29 into another keyring.)
31 Typically, the user keyring is created by
32 .BR pam_keyinit (8)
33 when a user logs in.
35 The user keyring is not searched by default by
36 .BR request_key (2).
37 When
38 .BR pam_keyinit (8)
39 creates a session keyring, it adds to it a link to the user
40 keyring so that the user keyring will be searched when the session keyring is.
42 A special serial number value,
43 .BR KEY_SPEC_USER_KEYRING ,
44 is defined that can be used in lieu of the actual serial number of
45 the calling process's user keyring.
47 From the
48 .BR keyctl (1)
49 utility, '\fB@u\fP' can be used instead of a numeric key ID in
50 much the same way.
52 User keyrings are independent of
53 .BR clone (2),
54 .BR fork (2),
55 .BR vfork (2),
56 .BR execve (2),
57 and
58 .BR _exit (2)
59 excepting that the keyring is destroyed when the UID record is destroyed when
60 the last process pinning it exits.
62 If it is necessary for a key associated with a user to exist beyond the UID
63 record being garbage collected\[em]for example, for use by a
64 .BR cron (8)
65 script\[em]then the
66 .BR persistent\-keyring (7)
67 should be used instead.
69 If a user keyring does not exist when it is accessed, it will be created.
70 .SH SEE ALSO
71 .ad l
72 .nh
73 .BR keyctl (1),
74 .BR keyctl (3),
75 .BR keyrings (7),
76 .BR persistent\-keyring (7),
77 .BR process\-keyring (7),
78 .BR session\-keyring (7),
79 .BR thread\-keyring (7),
80 .BR user\-session\-keyring (7),
81 .BR pam_keyinit (8)