This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: environment variables not propagating when i log in via sshd

John Owens wrote:

> When I log into a bash shell (as me) remotely through sshd, many variables are
> NOT visible. What's even weirder is that some are and some are not. So for
> visible, but other variables (the ones I define, in general) are not.
> How can I make my system environment variables appear when I ssh through sshd?

I believe this is because the ssh daemon starts out with an empty
environment for the child and then only populates it with a list of
certain known variables.  This is a security measure to prevent data
leaking from the privileged daemon process to the untrused user process.

The solution is to set the variables in the traditional *nix way, by
setting them in the appropriate rc file such as /etc/profile or the
user's ~/.profile.  Ssh also has a mechanism for allowing the connecting
user to specify environment variables to be set; see "man sshd" and "man
sshd_config" for details.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]