delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/12/29/23:41:42

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: Yes, hits=5.8 required=5.0 tests=AWL,BAYES_00,BOTNET,RCVD_IN_DNSWL_NONE,TW_HR
X-Spam-Check-By: sourceware.org
From: "Jeffrey J. Kosowsky" <cygwin AT kosowsky DOT org>
MIME-version: 1.0
Message-id: <19740.3442.794266.228950@consult.pretender>
Date: Wed, 29 Dec 2010 23:41:22 -0500
To: cygwin AT cygwin DOT com
Subject: Why are some default Windows environment variables not set when logging in via ssh?
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

When I run a cygwin bash terminal directly from Windows, I get all the
standard Windows environment variables properly set.

However, when I login in via ssh, some are properly set (e.g.,
$USERPROFILE, $ALLUSERSPROFILE, $HOMEDRIVE) but others are unset (e.g.,
$TEMP, $TMP, $APPDATA, $LOCALAPPDAT, PROGRAMFILES).

- Is this just a weird artifact of the fact that sshd is run by
  cyg_server rather than by the actual user (which perhaps explains why
  the variable $USERNAME is set to cyg_server)?

- Even so, why would PROGRAMFILES not be set right since that is
  presumably not user-dependent?

- Is there any logic behind which variables work and which ones don't?
 
- Is there any way to "fix" this so that the variables are set
  "normally"?
  (I could kluge this by setting them manually in my bashrc but I
   would prefer for them to be set right automatically)

THanks

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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