delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/08/11/08:09:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Message-ID: <4C6292D7.30002@cwilson.fastmail.fm>
Date: Wed, 11 Aug 2010 08:08:55 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Missing APPDATA var in env of ssh sessions?
References: <4C6225D9 DOT 2060604 AT cwilson DOT fastmail DOT fm> <20100811080107 DOT GA26152 AT calimero DOT vinschen DOT de>
In-Reply-To: <20100811080107.GA26152@calimero.vinschen.de>
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

On 8/11/2010 4:01 AM, Corinna Vinschen wrote:
> On Aug 11 00:23, Charles Wilson wrote:
>> Can ssh (or is it cygwin1.dll?) ensure that the user's APPDATA variable
>> is populated, since it appears to be a pretty important var for Windows
>> Vista+?
>
> In `man sshd' see the LOGIN PROCESS and SSHRC sections, as well as the
> AUTHORIZED_KEYS FILE FORMAT section.
> 
> In `man sshd_config' see the descriptions for AcceptEnv and
> PermitUserEnvironment.

Thanks. I was able to get the desired behavior by;

1) adding 'PermitUserEnvironment yes' to /etc/sshd_config
2) restarting sshd, and
3) Adding a new file, ~/.ssh/environment, with the following content
APPDATA=C:\Users\me\AppData\Roaming

Then, logging in via ssh, the new environment has the correct value, and
"mingw-get" doesn't litter my CWD with %APPDATA% directories.

I was thinking this facility might be made the default via updates to
ssh-user-config and ssh-host-config, but 'PermitUserEnvironment' carries
a pretty severe warning in 'man sshd_config', so probably not.

Those affected will probably find this thread, and the solution, for
themselves.

--
Chuck

--
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