{
    "mode": "man",
    "parameter": "PAM_ENV",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/PAM_ENV/7/json",
    "generated": "2026-06-15T18:52:42Z",
    "synopsis": "pamenv.so [debug] [conffile=conf-file] [envfile=env-file] [readenv=0|1]\n[userenvfile=env-file] [userreadenv=0|1]",
    "sections": {
        "NAME": {
            "content": "pamenv - PAM module to set/unset environment variables\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pamenv.so [debug] [conffile=conf-file] [envfile=env-file] [readenv=0|1]\n[userenvfile=env-file] [userreadenv=0|1]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pamenv PAM module allows the (un)setting of environment variables. Supported is the use\nof previously set environment variables as well as PAMITEMs such as PAMRHOST.\n\nBy default rules for (un)setting of variables are taken from the config file\n/etc/security/pamenv.conf. An alternate file can be specified with the conffile option.\n\nSecond a file (/etc/environment by default) with simple KEY=VAL pairs on separate lines will\nbe read. With the envfile option an alternate file can be specified. And with the readenv\noption this can be completely disabled.\n\nThird it will read a user configuration file ($HOME/.pamenvironment by default). The default\nfile can be changed with the userenvfile option and it can be turned on and off with the\nuserreadenv option.\n\nSince setting of PAM environment variables can have side effects to other modules, this\nmodule should be the last one on the stack.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "conffile=/path/to/pamenv.conf\nIndicate an alternative pamenv.conf style configuration file to override the default.\nThis can be useful when different services need different environments.\n",
            "subsections": [
                {
                    "name": "debug",
                    "content": "A lot of debug information is printed with syslog(3).\n\nenvfile=/path/to/environment\nIndicate an alternative environment file to override the default. The syntax are simple\nKEY=VAL pairs on separate lines. The export instruction can be specified for bash\ncompatibility, but will be ignored. This can be useful when different services need\ndifferent environments.\n\nreadenv=0|1\nTurns on or off the reading of the file specified by envfile (0 is off, 1 is on). By\ndefault this option is on.\n\nuserenvfile=filename\nIndicate an alternative .pamenvironment file to override the default.The syntax is the\nsame as for /etc/security/pamenv.conf. The filename is relative to the user home\ndirectory. This can be useful when different services need different environments.\n\nuserreadenv=0|1\nTurns on or off the reading of the user specific environment file. 0 is off, 1 is on. By\ndefault this option is off.\n"
                }
            ]
        },
        "MODULE TYPES PROVIDED": {
            "content": "The auth and session module types are provided.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMABORT\nNot all relevant data or options could be gotten.\n\nPAMBUFERR\nMemory buffer error.\n\nPAMIGNORE\nNo pamenv.conf and environment file was found.\n\nPAMSUCCESS\nEnvironment variables were set.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/security/pamenv.conf\nDefault configuration file\n\n/etc/environment\nDefault environment file\n\n$HOME/.pamenvironment\nUser specific environment file\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamenv.conf(5), pam.d(5), pam(8), environ(7).\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pamenv was written by Dave Kinchlea <kinch@kinch.ark.com>.\n\n\n\nLinux-PAM Manual                             06/08/2020                                   PAMENV(7)",
            "subsections": []
        }
    },
    "summary": "pamenv - PAM module to set/unset environment variables",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "pamenv.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pamenv.conf/5/json"
        },
        {
            "name": "pam.d",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.d/5/json"
        },
        {
            "name": "pam",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/pam/8/json"
        },
        {
            "name": "environ",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/environ/7/json"
        }
    ]
}