PAM_ENV(7)

๐Ÿ“ฆ
version 1.5.2 ยท 2 versions
, in debian bookworm

๐Ÿ’– PAM_ENV ๐Ÿ’–

okay bestie, welcome to PAM_ENV(7) โ€” the Linux-PAM Manual page for pam_env, and yes this is a real manual page, we're just doing it with โœจflavorโœจ now.


๐ŸŽ€ NAME ๐ŸŽ€

pam_env โ€” the PAM module that sets and unsets environment variables. That's it. That's the whole job. She does one thing and she slays at it. ๐Ÿ’…


โœจ SYNOPSIS โœจ

pam_env.so [debug] [conffile=conf-file] [envfile=env-file] [readenv=0|1]
           [user_envfile=env-file] [user_readenv=0|1]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so the pam_env PAM module lets you (un)set environment variables. and like, it's not just vibes โ€” it supports using environment variables that were already set, plus PAM_ITEMs such as PAM_RHOST. she's connected. she knows things. ๐Ÿ”ฅ

by default, the rules for (un)setting variables come from the config file /etc/security/pam_env.conf. want a different one? use the conffile option. easy. ๐Ÿซถ

secondly, a file (/etc/environment by default) gets read โ€” just simple KEY=VAL pairs, one per line, no drama. you can point her at an alternate file with the envfile option, and with the readenv option you can turn this whole thing off completely. ๐Ÿšซ

third, she'll read a user configuration file ($HOME/.pam_environment by default). change the default file with the user_envfile option, and flip it on or off with user_readenv. โœจ

ngl bestie, setting PAM environment variables can have side effects on other modules, so this module should be the last one on the stack. periodt. no negotiating. ๐Ÿ˜ญ

๐Ÿ’… OPTIONS ๐Ÿ’…

  • conffile=/path/to/pam_env.conf โ€” points to an alternative pam_env.conf-style configuration file to override the default. lowkey iconic when different services need different environments. ๐ŸŒˆ
  • debug โ€” prints a lot of debug information with syslog(3). a lot a lot. she's chatty. ๐Ÿ’€
  • envfile=/path/to/environment โ€” points to an alternative environment file to override the default. the syntax is simple KEY=VAL pairs on separate lines. the export instruction can be specified for bash compatibility, but it will be ignored (not her problem, don't ask). also useful when different services need different environments. โœจ
  • readenv=0|1 โ€” turns on or off the reading of the file specified by envfile (0 is off, 1 is on). by default this option is on. ๐Ÿ‘‘
  • user_envfile=filename โ€” points to an alternative .pam_environment file to override the default. the syntax is the same as for /etc/security/pam_env.conf. the filename is relative to the user home directory. useful when different services need different environments. ๐Ÿฆ‹
  • user_readenv=0|1 โ€” turns on or off the reading of the user specific environment file. 0 is off, 1 is on. by default this option is off, because user supplied environment variables in the PAM environment could affect the behavior of subsequent modules in the stack without the consent of the system administrator. ๐Ÿ˜ค
๐Ÿšจ and here's the big one: 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. do not build your whole personality around it, bestie. ๐Ÿ’€

โญ MODULE TYPES PROVIDED โญ

the auth and session module types are provided. two of them. matching set. ๐Ÿ’–


๐Ÿงš RETURN VALUES ๐Ÿงš

  • PAM_ABORT โ€” not all relevant data or options could be gotten. she couldn't get what she needed. relatable. ๐Ÿ˜ญ
  • PAM_BUF_ERR โ€” memory buffer error. ๐Ÿ’€
  • PAM_IGNORE โ€” no pam_env.conf and environment file was found. nowhere to look, nothing to do. ๐Ÿ™ˆ
  • PAM_SUCCESS โ€” environment variables were set. slay!! ๐Ÿ”ฅ๐Ÿ‘‘

๐Ÿ“ FILES ๐Ÿ“

  • /etc/security/pam_env.conf โ€” the default configuration file
  • /etc/environment โ€” the default environment file
  • $HOME/.pam_environment โ€” the user specific environment file

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

pam_env.conf(5), pam.d(5), pam(8), environ(7).

go read those too, iykyk. ๐Ÿ“šโœจ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

pam_env was written by Dave Kinchlea <kinch@kinch.ark.com>. legend behavior, honestly. ๐Ÿซถ


and that's the whole page bestie!! ๐Ÿ’– this was the Linux-PAM Manual version, dated 09/03/2021, page PAM_ENV(7) โ€” so if you're reading this from the future and something's different, that's a you-and-your-distro problem, not mine. mwah, go set some environment variables, love u, bye!! ๐ŸŽ€โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from