It should be possible to add environment variables to all sessions via /etc/environment or in /etc/security/pam_env.conf This works for console logins, but not with openssh logins. The problem appears to be that nothing in /etc/pam.d/sshd will load pam_env.so. Perhaps the libpam package should add this to /etc/pam.d/common-session? This file is referenced by the sshd pam configuration. E.g., add this: >session required pam_env.so readenv=1
Interesting suggestion. Debian does this. Can you send a patch to the list? https://docs.yoctoproject.org/contributor-guide/index.html
Trent do you have time for this? I've CCed Mingli who may be able to work on it if you can't or if you don't reply by March 25, 2025.
Mingli, Can you work on this and maybe email Trent if needed. He didn't reply to the YP BZ NEEDINFO emails.
Fixed by https://git.openembedded.org/openembedded-core/commit/?id=4e6762f5967b1996cf31ae100fa49e775dfb2866 https://git.openembedded.org/openembedded-core/commit/?id=4340cd7da25c69424915f29c2bb9531fc33617e6
[meta-selinux][PATCH 0/1] openssh: Add pam_env support https://lists.yoctoproject.org/g/yocto-patches/topic/meta_selinux_patch_0_1/117511888 [meta-selinux][PATCH 1/1] openssh: Add pam_env support https://lists.yoctoproject.org/g/yocto-patches/topic/meta_selinux_patch_1_1/117511975
Merged https://git.yoctoproject.org/meta-selinux/commit/?id=d670531ad7e6cd0dac08010fbd9b604501391245