Ssh – Windows user environment variables not available in OpenSSH session

environment-variablesssh

I am running OpenSSH server on my Windows XP machine. When I log in from a remote machine using PuTTY or any other ssh client, I am unable to see any of my user-level environment variables from the shell session. I see only the global ones.

Do I need to modify any settings for the remote session to gain access to all the windows environment variables?

Best Answer

It sounds like the OpenSSH service is running as the LOCAL SYSTEM or NETWORK accounts. Find the service in the Services control panel (Start -> Run: services.msc) and right-click + choose Properties. On the Log On tab, change the service to run under your account.

Warning: This may cause all SSH sessions to use your account in authenticating. This may not actually be a good thing, but if you are the only user it probably doesn't matter.