delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/20/21:09:38

X-Spam-Check-By: sourceware.org
Message-ID: <45397320.8A0B8658@dessent.net>
Date: Fri, 20 Oct 2006 18:08:48 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: environment variables not propagating when i log in via sshd
References: <20061021004659 DOT 40663 DOT qmail AT web53002 DOT mail DOT yahoo DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019