]> git.proxmox.com Git - systemd.git/blob - man/pam_systemd.8
198572550cc477710623b1fab3f38b79dcc71104
[systemd.git] / man / pam_systemd.8
1 '\" t
2 .TH "PAM_SYSTEMD" "8" "" "systemd 208" "pam_systemd"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 pam_systemd \- Register user sessions in the systemd login manager
24 .SH "SYNOPSIS"
25 .PP
26 pam_systemd\&.so
27 .SH "DESCRIPTION"
28 .PP
29 \fBpam_systemd\fR
30 registers user sessions with the systemd login manager
31 \fBsystemd-logind.service\fR(8), and hence the systemd control group hierarchy\&.
32 .PP
33 On login, this module ensures the following:
34 .sp
35 .RS 4
36 .ie n \{\
37 \h'-04' 1.\h'+01'\c
38 .\}
39 .el \{\
40 .sp -1
41 .IP " 1." 4.2
42 .\}
43 If it does not exist yet, the user runtime directory
44 /run/user/$USER
45 is created and its ownership changed to the user that is logging in\&.
46 .RE
47 .sp
48 .RS 4
49 .ie n \{\
50 \h'-04' 2.\h'+01'\c
51 .\}
52 .el \{\
53 .sp -1
54 .IP " 2." 4.2
55 .\}
56 The
57 \fI$XDG_SESSION_ID\fR
58 environment variable is initialized\&. If auditing is available and
59 \fBpam_loginuid\&.so\fR
60 run before this module (which is highly recommended), the variable is initialized from the auditing session id (/proc/self/sessionid)\&. Otherwise an independent session counter is used\&.
61 .RE
62 .sp
63 .RS 4
64 .ie n \{\
65 \h'-04' 3.\h'+01'\c
66 .\}
67 .el \{\
68 .sp -1
69 .IP " 3." 4.2
70 .\}
71 A new systemd scope unit is created for the session\&. If this is the first concurrent session of the user, an implicit slice below
72 user\&.slice
73 is automatically created and the scope placed in it\&. In instance of the system service
74 user@\&.service
75 which runs the systemd user manager instance\&.
76 .RE
77 .PP
78 On logout, this module ensures the following:
79 .sp
80 .RS 4
81 .ie n \{\
82 \h'-04' 1.\h'+01'\c
83 .\}
84 .el \{\
85 .sp -1
86 .IP " 1." 4.2
87 .\}
88 If this is enabled, all processes of the session are terminated\&. If the last concurrent session of a user ends, his user systemd instance will be terminated too, and so will the user\*(Aqs slice unit\&.
89 .RE
90 .sp
91 .RS 4
92 .ie n \{\
93 \h'-04' 2.\h'+01'\c
94 .\}
95 .el \{\
96 .sp -1
97 .IP " 2." 4.2
98 .\}
99 If the last concurrent session of a user ends, the
100 \fI$XDG_RUNTIME_DIR\fR
101 directory and all its contents are removed, too\&.
102 .RE
103 .PP
104 If the system was not booted up with systemd as init system, this module does nothing and immediately returns PAM_SUCCESS\&.
105 .SH "OPTIONS"
106 .PP
107 The following options are understood:
108 .PP
109 \fBclass=\fR
110 .RS 4
111 Takes a string argument which sets the session class\&. The XDG_SESSION_CLASS environmental variable takes precedence\&.
112 .RE
113 .PP
114 \fBdebug=\fR
115 .RS 4
116 Takes a boolean argument\&. If yes, the module will log debugging information as it operates\&.
117 .RE
118 .SH "MODULE TYPES PROVIDED"
119 .PP
120 Only
121 \fBsession\fR
122 is provided\&.
123 .SH "ENVIRONMENT"
124 .PP
125 The following environment variables are set for the processes of the user\*(Aqs session:
126 .PP
127 \fI$XDG_SESSION_ID\fR
128 .RS 4
129 A session identifier, suitable to be used in filenames\&. The string itself should be considered opaque, although often it is just the audit session ID as reported by
130 /proc/self/sessionid\&. Each ID will be assigned only once during machine uptime\&. It may hence be used to uniquely label files or other resources of this session\&.
131 .RE
132 .PP
133 \fI$XDG_RUNTIME_DIR\fR
134 .RS 4
135 Path to a user\-private user\-writable directory that is bound to the user login time on the machine\&. It is automatically created the first time a user logs in and removed on his final logout\&. If a user logs in twice at the same time, both sessions will see the same
136 \fI$XDG_RUNTIME_DIR\fR
137 and the same contents\&. If a user logs in once, then logs out again, and logs in again, the directory contents will have been lost in between, but applications should not rely on this behavior and must be able to deal with stale files\&. To store session\-private data in this directory, the user should include the value of
138 \fI$XDG_SESSION_ID\fR
139 in the filename\&. This directory shall be used for runtime file system objects such as
140 \fBAF_UNIX\fR
141 sockets, FIFOs, PID files and similar\&. It is guaranteed that this directory is local and offers the greatest possible file system feature set the operating system provides\&.
142 .RE
143 .SH "EXAMPLE"
144 .sp
145 .if n \{\
146 .RS 4
147 .\}
148 .nf
149 #%PAM\-1\&.0
150 auth required pam_unix\&.so
151 auth required pam_nologin\&.so
152 account required pam_unix\&.so
153 password required pam_unix\&.so
154 session required pam_unix\&.so
155 session required pam_loginuid\&.so
156 session required pam_systemd\&.so
157 .fi
158 .if n \{\
159 .RE
160 .\}
161 .SH "SEE ALSO"
162 .PP
163 \fBsystemd\fR(1),
164 \fBsystemd-logind.service\fR(8),
165 \fBlogind.conf\fR(5),
166 \fBloginctl\fR(1),
167 \fBpam.conf\fR(5),
168 \fBpam.d\fR(5),
169 \fBpam\fR(8),
170 \fBpam_loginuid\fR(8),
171 \fBsystemd.scope\fR(5),
172 \fBsystemd.slice\fR(5),
173 \fBsystemd.service\fR(5)