On a RHEL5 System with openssh-5.3p1-84.1.el6.x86_64 I defined the variable BLA in ~/.profile:

export BLA=hello

Then I run the following:

# ssh localhost 'echo $BLA'
# hello

I see that the variable BLA is defined.

When I compile openssh-6.2p2 from source and I use the same ssh configuration files, the variable is not defined anymore:

 # ssh localhost 'echo $BLA'

Any suggestions what I am missing?

BR, Rene


From the AcceptEnv section in the sshd_config man page:

"... The default is not to accept any environment variables."

Red Hat may not have used the default in their package, but your version compiled from source may have used the default setting as listed in the man page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.