delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/09/09/05:04:07

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=b2eZh/CfbQgJVQ1CX67Ph4R+hMN1X/No1wEbNRged2aNdQsDxswtc
FggdomTrlbsmAhiu2fO5DXciHpKgFPcIzocnWBKyyzkaL4OOtuyYQoVXiAGoVLl6
PfyFFEURONN4q5v37u6F46AkvCVqaF+nHBPBXN3k12J/zN4Xe13cnc=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=gQ8O9mFpd1K5a1JHeVE5itsjaCU=; b=KM4mFCYQC+KiP/wuaVW3cVWJkz1H
ONCwt3kJQcU124KlTmFrGOIsGsQOqRQ1G4gOk4p8cms0caLO1iicSEwqpa7AZY4b
K8XAtSvrP1mhtfgU7PcmMl4/3MqpqmhXR6wviUzSiHvZct1EVLE6o4GwEXUxHGVe
FvvkuCUq+YCpXbE=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-101.9 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=wagner, Wagner, SAM, UD:ntsec.html
X-HELO: drew.franken.de
Date: Sat, 9 Sep 2017 11:03:40 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: How to specify the user directory OUTSIDE of Cygwin (installation folder)?
Message-ID: <20170909090340.GC18477@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <190592 DOT 83283 DOT bm AT smtp101 DOT mail DOT ir2 DOT yahoo DOT com> <95cc51c1-8254-31b7-6a55-01810587ebdc AT gmail DOT com> <ba377295-9abd-e48f-974b-5280f5d27f86 AT wagner DOT is>
MIME-Version: 1.0
In-Reply-To: <ba377295-9abd-e48f-974b-5280f5d27f86@wagner.is>
User-Agent: Mutt/1.8.3 (2017-05-23)

--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

[top-posting fixed]

On Sep  9 10:31, J=C3=BCrgen Wagner wrote:
> On 09.09.2017 09:53, Marco Atzeri wrote:
> > On 09/09/2017 07:06, Ben Stover via cygwin wrote:
> >> By default the user folder of Cygwin (under Win7) is in a subdirectory
> >>
> >> <installation folder>\home\<username>
> >
> > from cygwin point of view "/home/<username>"
> >
> >> How can I put it into a separate directory OUTSIDE of Cygwin?
> >> [...]
> >> If possible I would like to specify my new home directory not as
> >> absolute but as relative path.
> >>
> >> I would prefer a customization somwhow in "Cygwin.bat" like:

We *have* extensive customization, see below.

> >>
> >> set cygwinhome=3D..\myhome
> >>
> >> Mind the double dots standing for "go up one level".
> >>
> >> How can I achieve this?
> >>
> >> Ben
> >>
> > mkpasswd -c >> /etc/passwd
> >
> > change the fifth field of "/etc/passwd"
> > from=C2=A0 "/home/<username>"
> > to "/cygdrive/d/tools/cygwin/myhome"
> >
> > close all cygwin process and rerun.

/etc/passwd should be the absolut last resort.  Preferredly the changes
are in /etc/nsswitch.conf and the user database, SAM or AD.  Here's the
howto:

  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-passwdinfo

For instance, change /etc/nsswitch.conf to contain

  db_home: /your/desired/homedir/%U

> Hi,
> =C2=A0 of course, you could change something in /etc/passwd to define a n=
ew
> home directory. However, it is good to have the convention of home
> directories being under one root (at least for non-administrative
> accounts). Therefore, my preferred solution is to make a symbolic link.
>=20
> /home/USER =3D> /cygdrive/d/tools/...
>=20
> You can have symbolic links with relative paths as a destination,
> however, that would assume you still are in the directory universe of
> Cygwin. In this case, you are not. Therefore, you have to address this
> via /cygdrive/...
>=20
> Besides... what is the advantage of having a relative path here, anyway?
> If you install different flavours of Cygwin as siblings under a common
> root, the absolute path will be the same for all instances.

I'd suggest a mount point in /etc/fstab instead, e.g.

  C:/cygwin64/newhome /home ntfs binary 0 0

That has the additional advantage that the POSIX ACL handling is
under your control, rather than being the default noacl handling
of cygdrive paths.

Alternatively, see the /etc/nsswitch.conf customizations above.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--2oS5YaxWCcQjTEyO
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJZs65sAAoJEPU2Bp2uRE+gB68QAKQj0jUAUpE8yMO8kjCl+16v
csXKRLxG0wvBWQxlcogbLvVqHUwV68mXrXubawM2qNP7GTDKLYQd93abFCjIXWWQ
KtSQQntNvrGjSSGbw4wfyUxQd3G65trAQaozy7gOUKtmWcHRVCiPfWVjpnYeM6zj
hOAjsX2fCxkpEQEnkotHL4PcY+w9sS+dR6wb7kgOOXawmAHTXH9MQ7O6ZlyhjXr6
BYfobYv3UkCrE6jxekzFhg4Zbdwbl1M3gesKjg34V6t9ArQpwiyiAWDtlM3gLtcx
U0Yj7HnGMLEtVE1tUxV17pNWhBtcqlZMouP0ueMlkvrh+aTugloY4QLudW7GTbZx
UYYdlffK8u2n4fEl9Xj6E0emHOy5Vq3EAAVHwRAf8souewRUX0OwBgDNbBnmXuqP
1r1VJS+FzuO+NostsB1NuXcfljexm8vEW7ypEkCwwWbZyFyMi+CysOcPFXDSGQfU
UgradUsBeHZUkoQIquvSWBS67O7ND4axkpoyd+pab/Mdwg4o1tI81c6xWHP8K7+A
HRK2XkmpnZGDtBOSYAc89AnbW7IGnvH/ObpPg2zlGox+YckmwmOk3FPtPAYiIDrZ
Cnw8+YSqdz3EBswiPal0lHRWMWb5KZKMEQPX7slxhvI/DL5dtfL0pH5iL4IrBcSA
7RUAwciZUjnW+gx2l1Gt
=WpM9
-----END PGP SIGNATURE-----

--2oS5YaxWCcQjTEyO--

- Raw text -


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