Debian Codegraph @

upstream/opensuse-tumbleweed/man8/pam_env.8

raw
1 '\" t
2 .\" Title: pam_env
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
5 .\" Date: 05/26/2026
6 .\" Manual: Linux-PAM Manual
7 .\" Source: Linux-PAM
8 .\" Language: English
9 .\"
10 .TH "PAM_ENV" "8" "05/26/2026" "Linux\-PAM" "Linux\-PAM Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pam_env \- PAM module to set/unset environment variables
32 .SH "SYNOPSIS"
33 .HP \w'\fBpam_env\&.so\fR\ 'u
34 \fBpam_env\&.so\fR [debug] [conffile=\fIconf\-file\fR] [envfile=\fIenv\-file\fR] [readenv=\fI0|1\fR] [user_envfile=\fIenv\-file\fR] [user_readenv=\fI0|1\fR]
35 .SH "DESCRIPTION"
36 .PP
37 The pam_env PAM module allows the (un)setting of environment variables\&. Supported is the use of previously set environment variables as well as
38 \fIPAM_ITEM\fRs such as
39 \fIPAM_RHOST\fR\&.
40 .PP
41 Rules for (un)setting of variables can be defined in an own config file\&. The path to this file can be specified with the
42 \fIconffile\fR
43 option\&. If this file does not exist, the default rules are taken from the config files
44 /etc/security/pam_env\&.conf
45 and
46 /etc/security/pam_env\&.conf\&.d/*\&.conf\&. If the file
47 /etc/security/pam_env\&.conf
48 does not exist, the rules are taken from the files
49 /usr/etc/security/pam_env\&.conf,
50 /usr/etc/security/pam_env\&.conf\&.d/*\&.conf
51 and
52 /etc/security/pam_env\&.conf\&.d/*\&.conf
53 in that order\&.
54 .PP
55 Environment variables can be defined in a file with simple
56 \fIKEY=VAL\fR
57 pairs on separate lines\&. The path to this file can be specified with the
58 \fIenvfile\fR
59 option\&. If this file has not been defined, the settings are read from the files
60 /etc/environment
61 and
62 /etc/environment\&.d/*\&. If the file
63 /etc/environment
64 does not exist, the settings are read from the files
65 /usr/etc/environment,
66 /usr/etc/environment\&.d/*
67 and
68 /etc/environment\&.d/*
69 in that order\&. And last but not least, with the
70 \fIreadenv\fR
71 option this mechanism can be completely disabled\&.
72 .PP
73 Third it will read a user configuration file ($HOME/\&.pam_environment
74 by default)\&. The default file can be changed with the
75 \fIuser_envfile\fR
76 option and it can be turned on and off with the
77 \fIuser_readenv\fR
78 option\&.
79 .PP
80 Since setting of PAM environment variables can have side effects to other modules, this module should be the last one on the stack\&.
81 .PP
82 This module is only executed if the main application calls
83 \fBpam_setcred\fR(3)
84 or
85 \fBpam_open_session\fR(3)\&. The module does nothing and returns
86 \fIPAM_IGNORE\fR
87 if called by
88 \fBpam_authenticate\fR(3)\&.
89 .SH "OPTIONS"
90 .PP
91 conffile=/path/to/pam_env\&.conf
92 .RS 4
93 Indicate an alternative
94 pam_env\&.conf
95 style configuration file to override the default\&. This can be useful when different services need different environments\&.
96 .RE
97 .PP
98 debug
99 .RS 4
100 A lot of debug information is printed with
101 \fBsyslog\fR(3)\&.
102 .RE
103 .PP
104 envfile=/path/to/environment
105 .RS 4
106 Indicate an alternative
107 environment
108 file to override the default\&. The syntax are simple
109 \fIKEY=VAL\fR
110 pairs on separate lines\&. The
111 \fIexport\fR
112 instruction can be specified for bash compatibility, but will be ignored\&. This can be useful when different services need different environments\&.
113 .RE
114 .PP
115 readenv=0|1
116 .RS 4
117 Turns on or off the reading of the file specified by envfile (0 is off, 1 is on)\&. By default this option is on\&.
118 .RE
119 .PP
120 user_envfile=filename
121 .RS 4
122 Indicate an alternative
123 \&.pam_environment
124 file to override the default\&. The syntax is the same as for
125 \fI/etc/security/pam_env\&.conf\fR\&. The filename is relative to the user home directory\&. This can be useful when different services need different environments\&.
126 .RE
127 .PP
128 user_readenv=0|1
129 .RS 4
130 Turns on or off the reading of the user specific environment file\&. 0 is off, 1 is on\&. By default this option is off as user supplied environment variables in the PAM environment could affect behavior of subsequent modules in the stack without the consent of the system administrator\&.
131 .sp
132 Due to problematic security this functionality is deprecated since the 1\&.5\&.0 version and will be removed completely at some point in the future\&.
133 .RE
134 .SH "MODULE TYPES PROVIDED"
135 .PP
136 The
137 \fBauth\fR
138 and
139 \fBsession\fR
140 module types are provided\&.
141 .SH "RETURN VALUES"
142 .PP
143 PAM_ABORT
144 .RS 4
145 Not all relevant data or options could be gotten\&.
146 .RE
147 .PP
148 PAM_BUF_ERR
149 .RS 4
150 Memory buffer error\&.
151 .RE
152 .PP
153 PAM_IGNORE
154 .RS 4
155 No pam_env\&.conf and environment file was found or the module got called by
156 \fBpam_authenticate\fR(3)\&.
157 .RE
158 .PP
159 PAM_SUCCESS
160 .RS 4
161 Environment variables were set\&.
162 .RE
163 .SH "FILES"
164 .PP
165 /usr/etc/security/pam_env\&.conf, /etc/security/pam_env\&.conf
166 .RS 4
167 Default configuration file
168 .RE
169 .PP
170 /usr/etc/environment, /etc/environment
171 .RS 4
172 Default environment file
173 .RE
174 .PP
175 $HOME/\&.pam_environment
176 .RS 4
177 User specific environment file
178 .RE
179 .SH "SEE ALSO"
180 .PP
181 \fBpam_env.conf\fR(5),
182 \fBpam.d\fR(5),
183 \fBpam\fR(8),
184 \fBenviron\fR(7)\&.
185 .SH "AUTHOR"
186 .PP
187 pam_env was written by Dave Kinchlea <kinch@kinch\&.ark\&.com>\&.