delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/01/22/12:58:40

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,TBC,TW_MK
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: How do I change the default home directory after I fire up cygwin?
Date: Tue, 22 Jan 2013 09:58:15 -0800
Lines: 40
Message-ID: <kdmjvk$tj9$1@ger.gmane.org>
References: <1358869942988-95558 DOT post AT n5 DOT nabble DOT com> <738549989 DOT 20130122203154 AT mtu-net DOT ru>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
In-Reply-To: <738549989.20130122203154@mtu-net.ru>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 1/22/2013 8:31 AM, Andrey Repin wrote:
> Greetings, Yves!
>
>> I start up cygwin and do pwd, and this is my home directory.
>> $ pwd
>> /cygdrive/h
>> But, I don't want it to be in /cygdrive/h.  So, what gives?  I've run the
>> mkpasswd command like so (while in my /home/<my name> directory):
>> mkpasswd -l -p "$(cygpath -H)" > /etc/passwd
>> At that point, I close my cygwin window and open it again... and same thing
>> when I run pwd.  How do I make cygwin think and start in /home/<my name>?
>> I've even mucked with the /etc/passwd for my user account and STILL no
>> result.
>> Very confused...
> Check the contents of your $HOME variable.
Yes, check the contents of your $HOME environment variable as set in 
Windows (not Cygwin) by looking at My Computer: Properties: Advanced: 
Environment Variables. Check both User and System Environment variables 
sections (user will override system). It is common in corporate 
environments to use the H drive to point to some remote file system that 
gets mounted at boot time. That's your real home directory and often the 
same home directory you'll use on Unix/Linux machines should your 
company have any of them. Sharing a home directory is a good thing.

As for /etc/password and /home/<userid>, what I usually do is figure out 
what this H drive points to and then add something like the following to 
/etc/fstab and do a mount -a:

    //<server>/<share>   /home/<userid> ntfs           
    binary,posix=0,user 0 0

and make sure your line in /etc/passwd sets your home directory to 
/home/<userid>. In this manner everybody's happy and no matter which 
architecture you're on (Windows/Linux/Solaris/etc) home is always 
/home/<userid>...

There's no place like $HOME... :-)
-- 
Andrew DeFaria <http://defaria.com>
This space for rent


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