openssh (6.2p2), inherit host environment variables to subsystem sftp-server process

Damien Miller djm at mindrot.org
Sat Sep 14 16:47:33 EST 2013


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


More information about the openssh-unix-dev mailing list