]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man7/user-keyring.7
inode.7: wfix
[thirdparty/man-pages.git] / man7 / user-keyring.7
1 .\"
2 .\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
4 .\"
5 .\" %%%LICENSE_START(GPLv2+_SW_ONEPARA)
6 .\" This program is free software; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License
8 .\" as published by the Free Software Foundation; either version
9 .\" 2 of the License, or (at your option) any later version.
10 .\" %%%LICENSE_END
11 .\"
12 .TH "USER-KEYRING" 7 2017-03-13 Linux "Linux Programmer's Manual"
13 .SH NAME
14 user-keyring \- per-user keyring
15 .SH DESCRIPTION
16 The user keyring is a keyring used to anchor keys on behalf of a user.
17 Each UID the kernel deals with has its own user keyring that
18 is shared by all processes with that UID.
19 The user keyring has a name (description) of the form
20 .I _uid.<UID>
21 where
22 .I <UID>
23 is the user ID of the corresponding user.
24 .PP
25 The user keyring is associated with the record that the kernel maintains
26 for the UID.
27 It comes into existence upon the first attempt to access either the
28 user keyring, the
29 .BR user-session-keyring (7),
30 or the
31 .BR session-keyring (7).
32 The keyring remains pinned in existence so long as there are processes
33 running with that real UID or files opened by those processes remain open.
34 (The keyring can also be pinned indefinitely by linking it
35 into another keyring.)
36 .PP
37 Typically, the user keyring is created by
38 .BR pam_keyinit (8)
39 when a user logs in.
40 .PP
41 The user keyring is not searched by default by
42 .BR request_key (2).
43 When
44 .BR pam_keyinit (8)
45 creates a session keyring, it adds to it a link to the user
46 keyring so that the user keyring will be searched when the session keyring is.
47 .PP
48 A special serial number value,
49 .BR KEY_SPEC_USER_KEYRING ,
50 is defined that can be used in lieu of the actual serial number of
51 the calling process's user keyring.
52 .PP
53 From the
54 .BR keyctl (1)
55 utility, '\fB@u\fP' can be used instead of a numeric key ID in
56 much the same way.
57 .PP
58 User keyrings are independent of
59 .BR clone (2),
60 .BR fork (2),
61 .BR vfork (2),
62 .BR execve (2),
63 and
64 .BR _exit (2)
65 excepting that the keyring is destroyed when the UID record is destroyed when
66 the last process pinning it exits.
67 .PP
68 If it is necessary for a key associated with a user to exist beyond the UID
69 record being garbage collected\(emfor example, for use by a
70 .BR cron (8)
71 script\(emthen the
72 .BR persistent-keyring (7)
73 should be used instead.
74 .PP
75 If a user keyring does not exist when it is accessed, it will be created.
76 .SH SEE ALSO
77 .ad l
78 .nh
79 .BR keyctl (1),
80 .BR keyctl (3),
81 .BR keyrings (7),
82 .BR persistent\-keyring (7),
83 .BR process\-keyring (7),
84 .BR session\-keyring (7),
85 .BR thread\-keyring (7),
86 .BR user\-session\-keyring (7),
87 .BR pam_keyinit (8)