I have a weird issue with my Debian Sid system. I want to set a global environment variable in /etc/environment
, which is supposed to be read by the pam_env
module. Unfortunately, after having relogin in the system, the variable is not set.
On another Arch Linux box, the same variable set in etc/environment
is defined as expected.
Just for testing, I tried to setup a local env variable in .pam_environment
and, again, on Debian it's not being defined while on Arch it is.
I'm using GDM on Debian and SDDM on Arch as login managers. What am I missing? Which (PAM or GDM) configuration files should I look at?
EDIT:
output of grep pam_env /etc/pam.d/*
$ grep pam_env /etc/pam.d/*
/etc/pam.d/atd:auth required pam_env.so
/etc/pam.d/cron:# Read environment variables from pam_env's default files, /etc/environment
/etc/pam.d/cron:# and /etc/security/pam_env.conf.
/etc/pam.d/cron:session required pam_env.so
/etc/pam.d/cron:session required pam_env.so envfile=/etc/default/locale
/etc/pam.d/gdm-autologin:session required pam_env.so readenv=1
/etc/pam.d/gdm-autologin:session required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/gdm-launch-environment:session required pam_env.so readenv=1
/etc/pam.d/gdm-launch-environment:session required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/gdm-password:session required pam_env.so readenv=1
/etc/pam.d/gdm-password:session required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/login:# file /etc/security/pam_env.conf.
/etc/pam.d/login:session required pam_env.so readenv=1
/etc/pam.d/login:session required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/polkit-1:session required pam_env.so readenv=1 user_readenv=0
/etc/pam.d/polkit-1:session required pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0
/etc/pam.d/su:# file /etc/security/pam_env.conf.
/etc/pam.d/su:session required pam_env.so readenv=1
/etc/pam.d/su:session required pam_env.so readenv=1 envfile=/etc/default/locale
grep -l pam_env /etc/pam.d/*
man pam_env
andman pam.d
. I don't know the answer here, but that's where I'd start investigating -- I notice not everything in pam.d references the pam_env modules.-l
from your grep command, thepam_env
module needsreadenv=1
to process the/etc/environment
file. Your grep output now doesn't tell whether that's enabled or not.ssh
to login to your system? Otherwise it all looks fine so I have no idea why it's not working for you. No messages appearing in some syslog file when you login that could indicate an error somewhere?