getent passwd which works for unprefixed Windows user names with both local and domain users?
Cedric Blancher
cedric.blancher@gmail.com
Tue Dec 10 13:35:54 GMT 2024
Good afternoon!
We have a Win10 env with mixed local and domain accounts.
We cannot lookup up local AND domain users with just the plain
username from Windows. Instead we have to do lookups twice:
1. Configuration:
$ hostname
LAB14
$ getent passwd
LAB14+SW-Install:*:197611:197121:U-LAB14\SW-Install,S-1-5-21-521464686-2813731464-1693715110-1003:/home/SW-Install:/bin/bash
2. Looking up user by plain Windows user name fails:
$ getent passwd 'SW-Install' || echo fail
fail
3. Looking up user by Hostname plus Windows user name works:
$ getent passwd 'LAB14+SW-Install' || echo fail
LAB14+SW-Install:*:197611:197121:U-LAB14\SW-Install,S-1-5-21-521464686-2813731464-1693715110-1003:/home/SW-Install:/bin/bash
But I cannot lookup domain users with getent passwd
"${domainname}+${winusername}" or getent passwd
"${hostname}+${winusername}"; only getent passwd "${winusername}"
works.
How can I lookup the passwd entries by plain unprefixed Windows user
name, for both local and domain users, without editing
/etc/nfsswitch.conf (IT policy says we are NOT to touch that file!!)
Ced
--
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
More information about the Cygwin
mailing list