This is the mail archive of the
mailing list for the Cygwin project.
Re: environment variables not propagating when i log in via sshd
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 20 Oct 2006 18:08:48 -0700
- Subject: Re: environment variables not propagating when i log in via sshd
- References: <email@example.com>
- Reply-to: cygwin at cygwin dot com
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
> instance, "PROCESSOR_LEVEL" and "PROCESSOR_IDENTIFIER" and "PATHEXT" are
> 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: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html