Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We had been using OpenSSH 3.8.1 P1 until moving to new Windows 64-bit environments. That version of OpenSSH returned the full Windows environment to the non-interactive SSH login, allowing us full access to the environment variables. In newer versions of OpenSSH, starting with 4.0, the environment returned is a paltry subset of the Windows System environment variables. We searched the OpenSSH mailing list discussion and found the request that it be changed to return "only what is needed", and it appears that was implemented in OpenSSH 4.0. I'm not sure who got to decide "what is needed", but it does not match our requirements. Is there some way to get OpenSSH to return the full Windows environment variable set without having to list specific ones in the .ssh/environment file, or a .bashrc or .profile file? Sometimes these variables change due to new tool version installations, and we don't want to have to modify an additional file to be able to execute via SSH.

share|improve this question

Might need some more details but...

My first thought is try using PsExec inside of your SSH session.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.