public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Conflict if same username local and in domain
@ 2020-10-29 12:39 David Balažic
  2020-10-29 20:42 ` L A Walsh
  2020-10-30  7:29 ` Andrey Repin
  0 siblings, 2 replies; 6+ messages in thread
From: David Balažic @ 2020-10-29 12:39 UTC (permalink / raw)
  To: cygwin

Hi!

I started Cygwin Terminal to find out, I landed in the other users
home folder and have no write access.

What happened was:
 - log into Windows as domain user DOM\JOE
 - start cygwin shell, land in /home/joe
 - log into Windows as local user JOE
 - start cygwin shell, land in /home/joe , but with no write access,
as it belongs to other user according to Windows


Is this a known issue? Should cygwin use a different username?
Help.

David

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Conflict if same username local and in domain
  2020-10-29 12:39 Conflict if same username local and in domain David Balažic
@ 2020-10-29 20:42 ` L A Walsh
  2020-10-31 10:56   ` David Balažic
  2020-10-30  7:29 ` Andrey Repin
  1 sibling, 1 reply; 6+ messages in thread
From: L A Walsh @ 2020-10-29 20:42 UTC (permalink / raw)
  To: David Balažic; +Cc: cygwin

On 2020/10/29 05:39, David Balažic via Cygwin wrote:
> Hi!
>
> I started Cygwin Terminal to find out, I landed in the other users
> home folder and have no write access.
>   
----
    I have the same username, but not the same "home" directory.
The user that signs in 1st gets the short name, the 2nd login gets
the domain or system name appended like
/users/linda/local-account
/users/linda.domain/domain account.

    Both of the user names have uniq windows UUID's and I have both in my
/etc/passwd.

    The two directories SHARE many of the same files -- so both my logins
are in a common 'local' group (like 'lindaGroup'), and since the machine
is in the domain, I can create a 'domain\lindagroup' and on my local
machine, both logins are in that group -- for that matter, the domain group
is also in the local group -- so theoretically I could just put both logins
in the domain group.

Anwyay, it DOES work -- it just has to be configured right.

So you say you got /home/joe for both -- but don't they have a /user 
directory
that is different for each?

just point your /home/=>/User, or if you really want them separate, then
have /home/joe point to /Users/joe/home, and the domain should get
joe.dom so /home/joe.dom => /Users/joe.dom/home.

I started with my /home dir pointed at my the same dir as my /users dir, so
by default, windows separated them.

Both my userid and username are different -- have 2 entries in /etc/passwd:

Bliss\linda:*:5013:201:L A 
Walsh,U-Bliss\linda,S-1-5-21-33333-77777-33333-5013:/Users/linda.Bliss:/bin/bash
linda:*:1000:1015:U-Athenae\linda,S-1-5-21-188-75-11-1000:/Users/linda:/bin/bash




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Conflict if same username local and in domain
  2020-10-29 12:39 Conflict if same username local and in domain David Balažic
  2020-10-29 20:42 ` L A Walsh
@ 2020-10-30  7:29 ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2020-10-30  7:29 UTC (permalink / raw)
  To: David Balažic, cygwin

Greetings, David Balažic!

> I started Cygwin Terminal to find out, I landed in the other users
> home folder and have no write access.

> What happened was:
>  - log into Windows as domain user DOM\JOE
>  - start cygwin shell, land in /home/joe
>  - log into Windows as local user JOE
>  - start cygwin shell, land in /home/joe , but with no write access,
> as it belongs to other user according to Windows


> Is this a known issue? Should cygwin use a different username?

This is a caveat of the default nsswitch configuration in Cygwin.
It uses home directories inside Cygwin's own directory tree by default and
name them after username without domain, but you can configure it to either
use a different home directory name or just use user's profile as home
directory. Which is, if you ask me, way more logical.

Be aware of the noacl flag for mounting directories outside Cygwin tree, or
you may surprise your Windows applications with less than trivial ACE setups
generated by Cygwin in "strict POSIX" mode.


-- 
With best regards,
Andrey Repin
Friday, October 30, 2020 10:25:49

Sorry for my terrible english...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Conflict if same username local and in domain
  2020-10-29 20:42 ` L A Walsh
@ 2020-10-31 10:56   ` David Balažic
  2020-11-02  3:45     ` L A Walsh
  2020-11-02  6:33     ` Andrey Repin
  0 siblings, 2 replies; 6+ messages in thread
From: David Balažic @ 2020-10-31 10:56 UTC (permalink / raw)
  To: L A Walsh; +Cc: cygwin

I don't have any of  /user /users /User /Users folders on my setup.
Do you mean C:\Users ?

Even if I symlink it, won't that just change the location, but not the
used usernames?

As for /etc/passwd , I don't have that file.
/etc/nsswitch.conf  is empty (only comments).

It is basically a fresh cygwin (64) installation with default settings.

Regards,
David

On Thu, 29 Oct 2020 at 21:42, L A Walsh <cygwin@tlinx.org> wrote:
>
> On 2020/10/29 05:39, David Balažic via Cygwin wrote:
> > Hi!
> >
> > I started Cygwin Terminal to find out, I landed in the other users
> > home folder and have no write access.
> >
> ----
>     I have the same username, but not the same "home" directory.
> The user that signs in 1st gets the short name, the 2nd login gets
> the domain or system name appended like
> /users/linda/local-account
> /users/linda.domain/domain account.
>
>     Both of the user names have uniq windows UUID's and I have both in my
> /etc/passwd.
>
>     The two directories SHARE many of the same files -- so both my logins
> are in a common 'local' group (like 'lindaGroup'), and since the machine
> is in the domain, I can create a 'domain\lindagroup' and on my local
> machine, both logins are in that group -- for that matter, the domain group
> is also in the local group -- so theoretically I could just put both logins
> in the domain group.
>
> Anwyay, it DOES work -- it just has to be configured right.
>
> So you say you got /home/joe for both -- but don't they have a /user
> directory
> that is different for each?
>
> just point your /home/=>/User, or if you really want them separate, then
> have /home/joe point to /Users/joe/home, and the domain should get
> joe.dom so /home/joe.dom => /Users/joe.dom/home.
>
> I started with my /home dir pointed at my the same dir as my /users dir, so
> by default, windows separated them.
>
> Both my userid and username are different -- have 2 entries in /etc/passwd:
>
> Bliss\linda:*:5013:201:L A
> Walsh,U-Bliss\linda,S-1-5-21-33333-77777-33333-5013:/Users/linda.Bliss:/bin/bash
> linda:*:1000:1015:U-Athenae\linda,S-1-5-21-188-75-11-1000:/Users/linda:/bin/bash
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Conflict if same username local and in domain
  2020-10-31 10:56   ` David Balažic
@ 2020-11-02  3:45     ` L A Walsh
  2020-11-02  6:33     ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: L A Walsh @ 2020-11-02  3:45 UTC (permalink / raw)
  To: David Balažic; +Cc: cygwin



On 2020/10/31 03:56, David Balažic wrote:
> I don't have any of  /user /users /User /Users folders on my setup.
> Do you mean C:\Users ?
---
	Sorry, yeah.
> 
> Even if I symlink it, won't that just change the location, but not the
> used usernames?
----
	You have one user in the Domain and one on the machine.  Right?
I mean, you've verified that they have different "GUIDs" or "UUIDs" --
meaning that windows see them each as separate accounts.

	When you login to each username under windows, run 'cmd.exe', then
echo %USERPROFILE%, %HOMEPATH%.  If you are getting the same value, I think 
you don't really have 2 accounts -- but since you got the access denied, it 
sounds like you do.

	Easiest is to put your homedir in or under your your HOMEPATH directory.

	like in cmd.exe, I think it's:

mklink /d C:\home "C:\%HOMEPATH%"

(sorta backwards what you might do at the cygwin prompt)...




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Conflict if same username local and in domain
  2020-10-31 10:56   ` David Balažic
  2020-11-02  3:45     ` L A Walsh
@ 2020-11-02  6:33     ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2020-11-02  6:33 UTC (permalink / raw)
  To: David Balažic, cygwin

Greetings, David Balažic!

Please no top-posting in this list.

>>
>> On 2020/10/29 05:39, David Balažic via Cygwin wrote:
>> > Hi!
>> >
>> > I started Cygwin Terminal to find out, I landed in the other users
>> > home folder and have no write access.
>> >
>> ----
>>     I have the same username, but not the same "home" directory.
>> The user that signs in 1st gets the short name, the 2nd login gets
>> the domain or system name appended like
>> /users/linda/local-account
>> /users/linda.domain/domain account.
>>
>>     Both of the user names have uniq windows UUID's and I have both in my
>> /etc/passwd.
>>
>>     The two directories SHARE many of the same files -- so both my logins
>> are in a common 'local' group (like 'lindaGroup'), and since the machine
>> is in the domain, I can create a 'domain\lindagroup' and on my local
>> machine, both logins are in that group -- for that matter, the domain group
>> is also in the local group -- so theoretically I could just put both logins
>> in the domain group.
>>
>> Anwyay, it DOES work -- it just has to be configured right.
>>
>> So you say you got /home/joe for both -- but don't they have a /user
>> directory
>> that is different for each?
>>
>> just point your /home/=>/User, or if you really want them separate, then
>> have /home/joe point to /Users/joe/home, and the domain should get
>> joe.dom so /home/joe.dom => /Users/joe.dom/home.
>>
>> I started with my /home dir pointed at my the same dir as my /users dir, so
>> by default, windows separated them.
>>
>> Both my userid and username are different -- have 2 entries in /etc/passwd:
>>
>> Bliss\linda:*:5013:201:L A
>> Walsh,U-Bliss\linda,S-1-5-21-33333-77777-33333-5013:/Users/linda.Bliss:/bin/bash
>> linda:*:1000:1015:U-Athenae\linda,S-1-5-21-188-75-11-1000:/Users/linda:/bin/bash
>>

> I don't have any of  /user /users /User /Users folders on my setup.
> Do you mean C:\Users ?

No, that's how her system was set up.

> Even if I symlink it, won't that just change the location, but not the
> used usernames?

True.

> As for /etc/passwd , I don't have that file.

And you generally don't need it.

> /etc/nsswitch.conf  is empty (only comments).

But you could configure it to your liking.

Me, personally, I'm using a combination of

$ cat /etc/fstab
none /cygdrive cygdrive noacl,binary,nouser,posix=0 0 0
none /tmp usertemp binary,nouser,posix=1 0 0
C:/Users /home bind noacl,binary,exec,posix=0 0 0

$ cat /etc/nsswitch.conf
passwd: db
group: db

db_enum: all

db_home: cygwin desc windows
db_shell: cygwin desc windows

$

This way, I have /home as a convenient access point, while real profile
locations are controlled by Windows itself.


-- 
With best regards,
Andrey Repin
Saturday, October 31, 2020 18:46:05

Sorry for my terrible english...

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-02  6:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 12:39 Conflict if same username local and in domain David Balažic
2020-10-29 20:42 ` L A Walsh
2020-10-31 10:56   ` David Balažic
2020-11-02  3:45     ` L A Walsh
2020-11-02  6:33     ` Andrey Repin
2020-10-30  7:29 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).