Tips and tricks: How can I configure winbind to synchronize user and group IDs across multiple Red Hat Enterprise Linux hosts on Active Directory accounts?
by the editorial team
Release Found: Red Hat Enterprise Linux 4 and 5
This article describes using the winbind idmap_rid mechanism to deliver a consistent mapping of Windows SIDs to UNIX user and group ids across multiple Red Hat Enterprise Linux hosts . It applies to Red Hat Enterprise Linux 4 and 5.
Using ldap for the idmap backend achieves a similar goal as explained in this kbase article: http://kbase.redhat.com/faq/FAQ_71_11146.shtm. However the benefit of using the rid idmap backend is that it doesn’t require any additional network servers or services to be configured. It does have one limitation though: it can only be used within single domain environments and is not compatible with trusted domain implementations.
Assumption:
The machine is joined to the AD domain and winbind is successfully being used for domain account authentication and the retrieval of domain account information. If this is not yet configured please consult other kbase articles for setting this up.
Configuration:
Edit /etc/samba/smb.conf and add the following entries to the [global] section:
allow trusted domains = no idmap backend = idmap_rid:MYDOMAIN=10000-20000
The values chosen for idmap_rid should be the same as the values for idmap uid and idmap gid. Restart smb and winbind for the idmaps to take effect .
The consistent id mapping is achieved by adding the value of the RID portion of the Windows SID value to the idmap base value. For example, using the range of values specified above, a user with a RID value of 1117 will be mapped to a UID value of 11117. This user will receive this same UID value across all Red Hat Enterprise Linux hosts using this same samba configuration. A user’s SID value can be viewed by running wbinfo -n <domainuser>
Caveat:
If domain users have already been queried or authenticated using winbind before setting up idmap_rid then they will have existing uid and gid values mapped to their Windows SID based on a first-come-first-served basis. These mappings have to be removed so that the consistent RID-based mappings can be used instead. Delete the winbind cache files containing the existing identity maps. These files are /var/cache/samba/winbind_*.tdb. After deleting these files, restart winbind to generate new idmap files.
The problem with this of course is that existing files and directories belonging to domain users will have the previous uid and gid values. The root user will have to run chown against these files to reflect the new id values.







November 13th, 2007 at 2:22 am
Thanks for the tip ..
When you say that ‘The root user will have to run chown against these files to reflect the new id values’ , you can first use setfacl to ’save’ permissions, configure the idmap backend, restart samba and winbind, and then use setfacl –restore to set correct permissions back … faster than chown …
November 13th, 2007 at 1:25 pm
Slight correction.For RHEL 4 you need at least U4 in place to use idmap_rid.