r/linuxadmin • • Apr 22 '26

Do you create POSIX attributes in AD for EVERY user??

Long story short we have a few servers operating as Samba in an AD (education) environment (education Linux Servers) so we're using WinBind for THOSE servers and SSSD for ALL OTHER RHEL/Ubuntu servers.

We're migrating from a POS OpenLDAP server (synced from AD) that gave constant auth headaches to DIRECT Active Directory auth using SSSD & Winbind so we settled on storing POSIX attributes in AD, pulling the UIDs/GIDs from the old OpenLDAP server and storing into AD and mapping on all servers so nothing breaks.

My fear is we've got a handful of Linux Desktops and so naturally what do we do about users who want access to those? I can do SSSD but now we gotta store UIDs/GIDs for all those users. Students come and go, so I'm assuming we need an automated way of creating UIDs/GIDs for new users. Curious if you guys have an automated way of creating UIDs/GIDs when new users get entered into AD? Or do you just create an entry/task on demand for new users who want to get setup into Linux??

My last resort is leave LDAP mapping off on some linux shared desktops so users can log in freely, but im leaning towards a full 100% lockdown and tracking uids/gids in a spreadsheet

10 Upvotes

12 comments sorted by

4

u/hortimech Apr 22 '26

Samba actually uses the SID and maps that to whatever Unix ID backend you set in the smb.conf file. The question you should be asking is, is Samba going to be used a fileserver ? If it is then you must use winbind and the only way to get the same IDs on all Unix machines is to use the 'ad' idmap backend, but you do not really need the rfc2307 attributes as the mapping is done locally, so you could use the 'rid' idmap backend if there is only one domain, or the 'autorid' idmap backend for multiple domains.

1

u/electrowiz64 Apr 22 '26

the problem is I want to use SSSD for literally EVERYTHING else as recommended by redhat and Ubuntu and I read that SSSD & Winbind compute their SIDs differently.

SO my fear was god forbid if users are trying to communicate between the 2 different servers, their IDs will NOT be the same and there would be permission issues. I could be overthinking it but I'm not trying to brick anything, even though id would LOVE to not use rfc2307

and it KILLS me but i cant escape Samba as educators are using it from windows clients to transfer data to/from the webservers

3

u/hortimech Apr 22 '26

Well redhat would recommend sssd, it is their product, written by the same person that wrote most of winbind and it is based on winbind. You shouldn't matter if your users don't have the same Unix ID, but you never know. Yes, sssd and winbind do compute Unix IDs differently (unless you use rfc2307 everywhere in Unix), that is where the ID backends come in.

What is wrong with using winbind instead of sssd ? winbind is just as easy to set up as sssd, once you know the correct method.

→ More replies (4)
→ More replies (1)

4

u/J4yD4n Apr 22 '26

SSSD generates the uid and gid by hashing the SID of the AD object, so as long as SSSD has the same starting point and size, which it will if it's the only domain you've joined the machine to, all machines will generate the same uid and gid. There's no reason to manually manage those attributes and hasn't been for years.

→ More replies (1)

2

u/[deleted] Apr 23 '26

[removed] — view removed comment

1

u/tidderwork Apr 23 '26 edited Apr 23 '26

We do this and we have a couple scripts that run every 5 or 10 minutes that find groups and other objects with missing attributes and it populates them. Our AD has hundreds of thousands of users and groups and this works just fine.

We also repurposed an attribute to store ssh keys as an array. We built a web interface for users to manage keys, shell, home directory path (if they want something other than /home).