pam_env.8 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. '\" t
  2. .\" Title: pam_env
  3. .\" Author: [see the "AUTHOR" section]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 09/03/2021
  6. .\" Manual: Linux-PAM Manual
  7. .\" Source: Linux-PAM Manual
  8. .\" Language: English
  9. .\"
  10. .TH "PAM_ENV" "8" "09/03/2021" "Linux-PAM Manual" "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. By default rules for (un)setting of variables are taken from the config file
  42. /etc/security/pam_env\&.conf\&. An alternate file can be specified with the
  43. \fIconffile\fR
  44. option\&.
  45. .PP
  46. Second a file (/etc/environment
  47. by default) with simple
  48. \fIKEY=VAL\fR
  49. pairs on separate lines will be read\&. With the
  50. \fIenvfile\fR
  51. option an alternate file can be specified\&. And with the
  52. \fIreadenv\fR
  53. option this can be completely disabled\&.
  54. .PP
  55. Third it will read a user configuration file ($HOME/\&.pam_environment
  56. by default)\&. The default file can be changed with the
  57. \fIuser_envfile\fR
  58. option and it can be turned on and off with the
  59. \fIuser_readenv\fR
  60. option\&.
  61. .PP
  62. Since setting of PAM environment variables can have side effects to other modules, this module should be the last one on the stack\&.
  63. .SH "OPTIONS"
  64. .PP
  65. \fBconffile=\fR\fB\fI/path/to/pam_env\&.conf\fR\fR
  66. .RS 4
  67. Indicate an alternative
  68. pam_env\&.conf
  69. style configuration file to override the default\&. This can be useful when different services need different environments\&.
  70. .RE
  71. .PP
  72. \fBdebug\fR
  73. .RS 4
  74. A lot of debug information is printed with
  75. \fBsyslog\fR(3)\&.
  76. .RE
  77. .PP
  78. \fBenvfile=\fR\fB\fI/path/to/environment\fR\fR
  79. .RS 4
  80. Indicate an alternative
  81. environment
  82. file to override the default\&. The syntax are simple
  83. \fIKEY=VAL\fR
  84. pairs on separate lines\&. The
  85. \fIexport\fR
  86. instruction can be specified for bash compatibility, but will be ignored\&. This can be useful when different services need different environments\&.
  87. .RE
  88. .PP
  89. \fBreadenv=\fR\fB\fI0|1\fR\fR
  90. .RS 4
  91. Turns on or off the reading of the file specified by envfile (0 is off, 1 is on)\&. By default this option is on\&.
  92. .RE
  93. .PP
  94. \fBuser_envfile=\fR\fB\fIfilename\fR\fR
  95. .RS 4
  96. Indicate an alternative
  97. \&.pam_environment
  98. file to override the default\&.The syntax is the same as for
  99. \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\&.
  100. .RE
  101. .PP
  102. \fBuser_readenv=\fR\fB\fI0|1\fR\fR
  103. .RS 4
  104. 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\&.
  105. .sp
  106. 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\&.
  107. .RE
  108. .SH "MODULE TYPES PROVIDED"
  109. .PP
  110. The
  111. \fBauth\fR
  112. and
  113. \fBsession\fR
  114. module types are provided\&.
  115. .SH "RETURN VALUES"
  116. .PP
  117. PAM_ABORT
  118. .RS 4
  119. Not all relevant data or options could be gotten\&.
  120. .RE
  121. .PP
  122. PAM_BUF_ERR
  123. .RS 4
  124. Memory buffer error\&.
  125. .RE
  126. .PP
  127. PAM_IGNORE
  128. .RS 4
  129. No pam_env\&.conf and environment file was found\&.
  130. .RE
  131. .PP
  132. PAM_SUCCESS
  133. .RS 4
  134. Environment variables were set\&.
  135. .RE
  136. .SH "FILES"
  137. .PP
  138. /etc/security/pam_env\&.conf
  139. .RS 4
  140. Default configuration file
  141. .RE
  142. .PP
  143. /etc/environment
  144. .RS 4
  145. Default environment file
  146. .RE
  147. .PP
  148. $HOME/\&.pam_environment
  149. .RS 4
  150. User specific environment file
  151. .RE
  152. .SH "SEE ALSO"
  153. .PP
  154. \fBpam_env.conf\fR(5),
  155. \fBpam.d\fR(5),
  156. \fBpam\fR(8),
  157. \fBenviron\fR(7)\&.
  158. .SH "AUTHOR"
  159. .PP
  160. pam_env was written by Dave Kinchlea <kinch@kinch\&.ark\&.com>\&.