ssh problem with $HOME

Bill C. Riemers
Fri Sep 5 16:15:00 GMT 2003

> I wasn't sure what you meant by the last sentence above.  I do set
> $HOME in windows, so all apps can benefit from it, and /etc/profile
> honours that.  Why ssh feels the need to look at /etc/passwd, when it
> is documented to look at $HOME, I don't know.

Quite simple.  When you run "ssh" it calls "sshd" through a socket
sshd is running as SYSTEM.  It is unlikely that the home directory for the
directory for SYSTEM is the same as your home directory.   Since "sshd" is a
program, not a Windows program it uses the standard method of setting the
environmental variable, which is to look it up from /etc/passwd.

For example, on the computer I'm on now, my $HOME is /home/docbill .  My
wife's $HOME is /home/olivia .  SYSTEM's $HOME is /home/SYSTEM.  So if I do:
        ssh -l olivia localhost
sshd has to find out what my wife's home directory.  Not my home directory,
nor SYSTEM's home directory.  If instead it where just to use the current
value of "$HOME", I could change it to enter my wife's account even if I did
not know her password or the Administrator's password.


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list