pam_env.8.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
  4. <refentry id='pam_env'>
  5. <refmeta>
  6. <refentrytitle>pam_env</refentrytitle>
  7. <manvolnum>8</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id='pam_env-name'>
  11. <refname>pam_env</refname>
  12. <refpurpose>
  13. PAM module to set/unset environment variables
  14. </refpurpose>
  15. </refnamediv>
  16. <!-- body begins here -->
  17. <refsynopsisdiv>
  18. <cmdsynopsis id="pam_env-cmdsynopsis">
  19. <command>pam_env.so</command>
  20. <arg choice="opt">
  21. debug
  22. </arg>
  23. <arg choice="opt">
  24. conffile=<replaceable>conf-file</replaceable>
  25. </arg>
  26. <arg choice="opt">
  27. envfile=<replaceable>env-file</replaceable>
  28. </arg>
  29. <arg choice="opt">
  30. readenv=<replaceable>0|1</replaceable>
  31. </arg>
  32. <arg choice="opt">
  33. user_envfile=<replaceable>env-file</replaceable>
  34. </arg>
  35. <arg choice="opt">
  36. user_readenv=<replaceable>0|1</replaceable>
  37. </arg>
  38. </cmdsynopsis>
  39. </refsynopsisdiv>
  40. <refsect1 id="pam_env-description">
  41. <title>DESCRIPTION</title>
  42. <para>
  43. The pam_env PAM module allows the (un)setting of environment
  44. variables. Supported is the use of previously set environment
  45. variables as well as <emphasis>PAM_ITEM</emphasis>s such as
  46. <emphasis>PAM_RHOST</emphasis>.
  47. </para>
  48. <para>
  49. By default rules for (un)setting of variables are taken from the
  50. config file <filename>/etc/security/pam_env.conf</filename>. An
  51. alternate file can be specified with the <emphasis>conffile</emphasis>
  52. option.
  53. </para>
  54. <para>
  55. Second a file (<filename>/etc/environment</filename> by default) with simple
  56. <emphasis>KEY=VAL</emphasis> pairs on separate lines will be read.
  57. With the <emphasis>envfile</emphasis> option an alternate file can be specified.
  58. And with the <emphasis>readenv</emphasis> option this can be completely disabled.
  59. </para>
  60. <para>
  61. Third it will read a user configuration file
  62. (<filename>$HOME/.pam_environment</filename> by default).
  63. The default file can be changed with the
  64. <emphasis>user_envfile</emphasis> option
  65. and it can be turned on and off with the <emphasis>user_readenv</emphasis> option.
  66. </para>
  67. <para>
  68. Since setting of PAM environment variables can have side effects
  69. to other modules, this module should be the last one on the stack.
  70. </para>
  71. </refsect1>
  72. <refsect1 id="pam_env-options">
  73. <title>OPTIONS</title>
  74. <variablelist>
  75. <varlistentry>
  76. <term>
  77. <option>conffile=<replaceable>/path/to/pam_env.conf</replaceable></option>
  78. </term>
  79. <listitem>
  80. <para>
  81. Indicate an alternative <filename>pam_env.conf</filename>
  82. style configuration file to override the default. This can
  83. be useful when different services need different environments.
  84. </para>
  85. </listitem>
  86. </varlistentry>
  87. <varlistentry>
  88. <term>
  89. <option>debug</option>
  90. </term>
  91. <listitem>
  92. <para>
  93. A lot of debug information is printed with
  94. <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
  95. </para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry>
  99. <term>
  100. <option>envfile=<replaceable>/path/to/environment</replaceable></option>
  101. </term>
  102. <listitem>
  103. <para>
  104. Indicate an alternative <filename>environment</filename>
  105. file to override the default. The syntax are simple
  106. <emphasis>KEY=VAL</emphasis> pairs on separate lines. The
  107. <emphasis>export</emphasis> instruction can be specified for bash
  108. compatibility, but will be ignored.
  109. This can be useful when different services need different environments.
  110. </para>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term>
  115. <option>readenv=<replaceable>0|1</replaceable></option>
  116. </term>
  117. <listitem>
  118. <para>
  119. Turns on or off the reading of the file specified by envfile
  120. (0 is off, 1 is on). By default this option is on.
  121. </para>
  122. </listitem>
  123. </varlistentry>
  124. <varlistentry>
  125. <term>
  126. <option>user_envfile=<replaceable>filename</replaceable></option>
  127. </term>
  128. <listitem>
  129. <para>
  130. Indicate an alternative <filename>.pam_environment</filename>
  131. file to override the default.The syntax is the same as
  132. for <emphasis>/etc/security/pam_env.conf</emphasis>.
  133. The filename is relative to the user home directory.
  134. This can be useful when different services need different
  135. environments.
  136. </para>
  137. </listitem>
  138. </varlistentry>
  139. <varlistentry>
  140. <term>
  141. <option>user_readenv=<replaceable>0|1</replaceable></option>
  142. </term>
  143. <listitem>
  144. <para>
  145. Turns on or off the reading of the user specific environment
  146. file. 0 is off, 1 is on. By default this option is off as user
  147. supplied environment variables in the PAM environment could affect
  148. behavior of subsequent modules in the stack without the consent
  149. of the system administrator.
  150. </para>
  151. <para>
  152. Due to problematic security this functionality is deprecated
  153. since the 1.5.0 version and will be removed completely at some
  154. point in the future.
  155. </para>
  156. </listitem>
  157. </varlistentry>
  158. </variablelist>
  159. </refsect1>
  160. <refsect1 id="pam_env-types">
  161. <title>MODULE TYPES PROVIDED</title>
  162. <para>
  163. The <option>auth</option> and <option>session</option> module
  164. types are provided.
  165. </para>
  166. </refsect1>
  167. <refsect1 id="pam_env-return_values">
  168. <title>RETURN VALUES</title>
  169. <variablelist>
  170. <varlistentry>
  171. <term>PAM_ABORT</term>
  172. <listitem>
  173. <para>
  174. Not all relevant data or options could be gotten.
  175. </para>
  176. </listitem>
  177. </varlistentry>
  178. <varlistentry>
  179. <term>PAM_BUF_ERR</term>
  180. <listitem>
  181. <para>
  182. Memory buffer error.
  183. </para>
  184. </listitem>
  185. </varlistentry>
  186. <varlistentry>
  187. <term>PAM_IGNORE</term>
  188. <listitem>
  189. <para>
  190. No pam_env.conf and environment file was found.
  191. </para>
  192. </listitem>
  193. </varlistentry>
  194. <varlistentry>
  195. <term>PAM_SUCCESS</term>
  196. <listitem>
  197. <para>
  198. Environment variables were set.
  199. </para>
  200. </listitem>
  201. </varlistentry>
  202. </variablelist>
  203. </refsect1>
  204. <refsect1 id="pam_env-files">
  205. <title>FILES</title>
  206. <variablelist>
  207. <varlistentry>
  208. <term><filename>/etc/security/pam_env.conf</filename></term>
  209. <listitem>
  210. <para>Default configuration file</para>
  211. </listitem>
  212. </varlistentry>
  213. <varlistentry>
  214. <term><filename>/etc/environment</filename></term>
  215. <listitem>
  216. <para>Default environment file</para>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry>
  220. <term><filename>$HOME/.pam_environment</filename></term>
  221. <listitem>
  222. <para>User specific environment file</para>
  223. </listitem>
  224. </varlistentry>
  225. </variablelist>
  226. </refsect1>
  227. <refsect1 id="pam_env-see_also">
  228. <title>SEE ALSO</title>
  229. <para>
  230. <citerefentry>
  231. <refentrytitle>pam_env.conf</refentrytitle><manvolnum>5</manvolnum>
  232. </citerefentry>,
  233. <citerefentry>
  234. <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
  235. </citerefentry>,
  236. <citerefentry>
  237. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  238. </citerefentry>,
  239. <citerefentry>
  240. <refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum>
  241. </citerefentry>.
  242. </para>
  243. </refsect1>
  244. <refsect1 id="pam_env-authors">
  245. <title>AUTHOR</title>
  246. <para>
  247. pam_env was written by Dave Kinchlea &lt;kinch@kinch.ark.com&gt;.
  248. </para>
  249. </refsect1>
  250. </refentry>