delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/27/13:08:14

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4D8F6EF3.60302@gmail.com>
Date: Sun, 27 Mar 2011 10:08:03 -0700
From: Jay Adams <jayadams0x1 AT gmail DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Solution to using different usernames
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

I was able to achieve the desired result without modifiying /etc/passwd.
What I did was expand /etc/profile.d/user.sh to:
# use Windows's USERNAME variable
USER=$USERNAME
export USER

HOME=/home/$USER
export HOME

Next I zeroed out /etc/passwd so it was a blank file. Combine these
together and SSH now found the right user. I did some testing, it turns
out that you don't really have to expand /etc/profile.d/user.sh. I think
if Cygwin doesn't get what it wants from /etc/passwd it moves to check
somewhere else. Also, I was told this might cause problems when changing
user; I've never had to change users so I don't know how to test for it.

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