Martin Jacobs
2013-Sep-13 19:29 UTC
openssh (6.2p2), inherit host environment variables to subsystem sftp-server process
Hi, is there a regular way that a subsystem process (sftpserver here) inherits environment variables from its parent (sshd)? Namely LANG and LC_* variables. In my case it's important to get the variable of hosting environment and not from client side (AcceptEnv). Regards Martin -- Registered Linux User #87175, http://linuxcounter.net
Damien Miller
2013-Sep-14 06:47 UTC
openssh (6.2p2), inherit host environment variables to subsystem sftp-server process
On Fri, 13 Sep 2013, Martin Jacobs wrote:> Hi, > > is there a regular way that a subsystem process (sftpserver > here) inherits environment variables from its parent (sshd)? > Namely LANG and LC_* variables. > > In my case it's important to get the variable of hosting > environment and not from client side (AcceptEnv).Subsystems like sftp are executed via the the user's shell, so you can place environment variables in a non-interactive shell initialisation file and they will be passed through. Otherwise, you could add them to the ones that are copied from sshd to its child session processes in session.c:do_setup_env() It might be worth reviewing these... -d