<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15767</bug_id>
          
          <creation_ts>2025-02-20 21:26:09 +0000</creation_ts>
          <short_desc>openssh session don&apos;t use /etc/environment nor /etc/security/pam_env.conf</short_desc>
          <delta_ts>2026-02-03 14:23:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>connectivity</component>
          <version>5.0.7</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Trent Piepho">trent.piepho</reporter>
          <assigned_to name="Mingli Yu">mingli.yu</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mingli.yu</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yoann.congal</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101192</commentid>
    <comment_count>0</comment_count>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2025-02-20 21:26:09 +0000</bug_when>
    <thetext>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:
&gt;session required        pam_env.so readenv=1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101239</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-27 15:33:37 +0000</bug_when>
    <thetext>Interesting suggestion. Debian does this.

Can you send a patch to the list?
https://docs.yoctoproject.org/contributor-guide/index.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101456</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-03-21 20:12:11 +0000</bug_when>
    <thetext>Trent do you have time for this?
I&apos;ve CCed Mingli who may be able to work on it if you can&apos;t or if you don&apos;t reply by March 25, 2025.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101617</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-04-10 15:02:36 +0000</bug_when>
    <thetext>Mingli, Can you work on this and maybe email Trent if needed.
He didn&apos;t reply to the YP BZ NEEDINFO emails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101752</commentid>
    <comment_count>4</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2025-04-25 01:09:21 +0000</bug_when>
    <thetext>Fixed by
https://git.openembedded.org/openembedded-core/commit/?id=4e6762f5967b1996cf31ae100fa49e775dfb2866

https://git.openembedded.org/openembedded-core/commit/?id=4340cd7da25c69424915f29c2bb9531fc33617e6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104089</commentid>
    <comment_count>5</comment_count>
    <who name="Clayton Casciato">ccasciato</who>
    <bug_when>2026-01-28 17:43:36 +0000</bug_when>
    <thetext>[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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104142</commentid>
    <comment_count>6</comment_count>
    <who name="Clayton Casciato">ccasciato</who>
    <bug_when>2026-02-03 14:23:07 +0000</bug_when>
    <thetext>Merged
https://git.yoctoproject.org/meta-selinux/commit/?id=d670531ad7e6cd0dac08010fbd9b604501391245</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>