[Samba] Best way to generate Unix UIDs and GIDs?
yvan at masson-informatique.fr
Mon Jan 15 09:25:34 UTC 2018
Le 14/01/2018 à 15:51, Rowland Penny via samba a écrit :
> On Sun, 14 Jan 2018 14:53:15 +0100
> Yvan Masson via samba <samba at lists.samba.org> wrote:
>> For a new samba domain, I need to create users and groups with Unix
>> UIDs and GIDs.
>> In the future, it is possible that there will be a trust with other
>> domains, so I need to take care that there won't be any UID/GID
>> conflict. Also, I assume that in the future Samba will be able to
>> restore deleted objects, so I need to avoid conflicts with those
>> objects as well.
>> This makes me think that a good way would be to generate UIDs/GUIDs
>> from SID. I know SSSD does it (apparently not ensuring
>> consistency), but I could not find a script that does only this.
>> However, I found this python script which seems to be what
>> Centrify does.
>> What do you think about all of this?
>> 2. https://gist.github.com/msmorul/11217186
> Can I suggest you read this:
> and this:
I was thinking that a good practice would be to fill uidNumber and
guidNumber attributes in Samba AD, and that RID ID mapping would not be
adequate for many network. After reading this doc again, and making
apart home path, shell and gecos, it seems I was wrong and that using
rfc2307 is not worth the effort for many setups.
> winbind will do what you require, I cannot comment on , sssd has
> NOTHING to do with Samba.
I know sssd has nothing to do with Samba, but it is usually Samba admin
that would add Unix UIDs/GIDs to AD, hence my question on this mailing list.
I also cannot recommend using , from
> examining the script, it would appear that it would be possible to get
> the same ID for two users from different domains e.g. if we take these
> two SID-RIDS:
> It appears the script would take a portion of the end of the SID, add
> '0' the the RID, so they could be:
> How would Samba and Unix tell them apart ?
> Windows could tell the two SID-RIDs apart.
Thanks for spotting the weakness of this script.
Thus I believe a perfect solution to calculate UIDs/GIDs from SID does
not exist yet, or is not possible (no maths formula can ensure
uniqueness of Unix IDs from SIDs across domain).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 874 bytes
Desc: OpenPGP digital signature
More information about the samba