Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >
article

KB-2982: 'ssh hostname printenv' returns only a partial list of environment variables

Centrify DirectAudit ,   Centrify DirectControl ,   Centrify Identity Service, Mac Edition ,  

12 April,16 at 11:13 AM

Applies to:  All versions of Centrify-Enabled OpenSSH on SLES 10

Problem:
When a ssh command 'ssh hostname printenv' is ran against a remote server, only a partial list of environment variables gets printed. Once you're logged into the server, executing env will list all the environment variables. 

Note: This works on SLES 11 and not on SLES 10

Cause:
It is because on SLES 10, /etc/bash.bashrc is not executed for ssh command executed sessions.

config-top.h ( from bash source ) indicates bashrc was defined but commented so it never runs bash.bashrc:
config-top.h:87:/* #define SSH_SOURCE_BASHRC */

Where as on SLES 11 the same was uncommented so bashrc gets executed:

config-top.h:87:#define SSH_SOURCE_BASHRC

Resolution:
In order to print the complete environment variables, you can run the following syntax:

ssh hostname export BASH_ENV=/etc/bash.bashrc && printenv

 

Still have questions? Click here to log a technical support case, or collaborate with your peers in Centrify's Online Community.