This is the mail archive of the
cygwin
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: <20061021004659.40663.qmail@web53002.mail.yahoo.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.
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/