Missing environment variables when ssh'ing into Windows machine

cygwin@kosowsky.org cygwin@kosowsky.org
Fri Jan 3 06:59:00 GMT 2020


The Windows variables $USERNAME, $USERPROFILE and $USERDOMAIN are set properly
when opening a cygwin bash shell on a Windows 10 machine.  

However when I *ssh* into that same machine (under the same user name),
the variables are unset in the bash shell.

More generally, it seems that none of my Windows User variables are
set under a remote ssh bash shell while they are all inherited properly
when opening a cygwin bash shell directly on the machine.

I have not had that problem in the past on my other (older) Windows
machine
The only differences that come to mind are:
1. The other machine is Win7 and not Win10
2. On this (Win10) machine I installed cygwin as a non-admin while the
   Win7 machine was installed with admin privileges
3. Because of #2, I start ssh on the Win 10 machine by running
   /usr/sbin/sshd manually as a user, while on Win 7, I am able to
   start sshd as a service, running as SYSTEM
4. This (Win10) machine doesn't have an /etc/passwd file whereas the
   Win7 machine does.

I am assuming that #3 may be the source of the problem...

Still seems strange that these seemingly very basic Windows variables
are not available under ssh.

Any way to fix this?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list