Set Proxy Variables in /etc/environment for PAM Login Sessions
Use literal KEY=value entries for PAM’s environment file and distinguish them from shell startup commands.
When a login service uses pam_env to read /etc/environment, the file supplies simple environment data:
http_proxy=http://proxy.example:8080
https_proxy=http://proxy.example:8080
Use complete literal values. For sessions whose public requests may use public intermediaries, the HTTP proxy list provides candidates for these HTTP URLs. This is not a shell script for running commands, invoking export or building a URL through command substitution. Linux-PAM documents an export prefix for compatibility, but ignores that instruction; the KEY=value form states the data directly.
Whether the file is loaded depends on the login service’s PAM configuration and environment-file options. Existing applications do not refresh their environment merely because the file changed. A new participating login session is the relevant lifecycle boundary.
Applications must still support these variables. A browser, system service or explicitly configured HTTP client can have another proxy-selection path, so the file is not a rule forcing every socket through the intermediary.