Rowland, I was just reading over another thread on this list about the inability to access group policy from client machines. The user did not have the symlinks setup (I do) but one thing you mentioned was using the NIS attributes to set UID/GID numbers for the domain. You said we should not do this for certain users and groups, but there is no mention of this in the guides to setting up an AD DC, so I have always done it. We do this to make our Linux-based NAS devices work. Furthermore, you recommended the user use the idmap lines to ensure consistent UID/GID numbers across devices, yet you suggested I turn the exact same lines off in my config. Why is this? I understand our situations are different, but when should we set winbind to use the AD backend and set UID/GID numbers? How do do this so Linux-base file services can be accessed by users and come out the same? To be specific, these are the commented lines in my config file. They look like what you recommended to the user Richard to ensure consistent UID and GID numbers. # idmap config *:backend = tdb # idmap config *:range = 2001-10000 # idmap config TRUEVINE:backend = ad # idmap config TRUEVINE:schema_mode = rfc2307 # idmap config TRUEVINE:range = 10001-20000 Lead IT/IS Specialist Reach Technology FP, Inc On 01/14/2017 11:40 AM, Rowland Penny via samba wrote:> On Sat, 14 Jan 2017 11:17:57 -0500 > Ryan Ashley via samba <samba at lists.samba.org> wrote: > >> Rowland, I commented out what you asked me to, no change. >> >> # Global parameters >> [global] >> workgroup = TRUEVINE >> realm = TRUEVINE.LAN >> netbios name = DC01 >> server role = active directory domain controller >> server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, >> drepl, winbi$ >> # idmap_ldb:use rfc2307 = yes >> # idmap config *:backend = tdb >> # idmap config *:range = 2001-10000 >> # idmap config TRUEVINE:backend = ad >> # idmap config TRUEVINE:schema_mode = rfc2307 >> # idmap config TRUEVINE:range = 10001-20000 >> # domain master = yes >> # local master = yes >> # preferred master = yes >> # os level = 255 >> >> [netlogon] >> path = /var/lib/samba/sysvol/truevine.lan/scripts >> read only = No >> >> [sysvol] >> path = /var/lib/samba/sysvol >> read only = No >> >> Results: >> root at dc01:~# nano -w /etc/samba/smb.conf >> root at dc01:~# service samba4 stop >> [ ok ] Stopping Samba AD DC daemon: samba. >> root at dc01:~# service samba4 start >> [ ok ] Starting Samba AD DC daemon: samba. >> root at dc01:~# smbclient -L \\localhost -U administrator >> Enter administrator's password: >> session setup failed: NT_STATUS_INVALID_SID >> root at dc01:~# >> >> Lead IT/IS Specialist >> Reach Technology FP, Inc >> >> On 01/13/2017 01:07 PM, Rowland Penny via samba wrote: >>> On Fri, 13 Jan 2017 12:46:27 -0500 >>> Ryan Ashley via samba <samba at lists.samba.org> wrote: >>> >>>> OK, I noticed that also, but why does everything return >>>> NT_STATUS_INVALID_SID? Even if I run "smbclient -L \\localhost -U >>>> adminnamehere" on the DC itself, I get the error. At this point we >>>> are looking at erasing every workstation, wiping the DC, and >>>> starting from scratch. It has been a week and not even rolling >>>> back to 4.4 fixed it. What should my next steps be? I attached the >>>> server configuration file for reference. Note that it has run this >>>> way for a year without a hitch and nothing has been changed since >>>> day 1. >>>> >>>> # Global parameters >>>> [global] >>>> workgroup = TRUEVINE >>>> realm = TRUEVINE.LAN >>>> netbios name = DC01 >>>> server role = active directory domain controller >>>> server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, >>>> drepl, winbindd, ntp_signd, kcc, dnsupdate >>>> idmap_ldb:use rfc2307 = yes >>>> idmap config *:backend = tdb >>>> idmap config *:range = 2001-10000 >>>> idmap config TRUEVINE:backend = ad >>>> idmap config TRUEVINE:schema_mode = rfc2307 >>>> idmap config TRUEVINE:range = 10001-20000 >>>> domain master = yes >>>> local master = yes >>>> preferred master = yes >>>> os level = 255 >>>> >>>> [netlogon] >>>> path = /var/lib/samba/sysvol/truevine.lan/scripts >>>> read only = No >>>> >>>> [sysvol] >>>> path = /var/lib/samba/sysvol >>>> read only = No >>>> >>> >>> Now I have seen your smb.conf, I think I can tell you why you are >>> getting 'NT_STATUS_INVALID_SID' >>> >>> You have 'idmap config' lines, these do nothing on a DC, or rather >>> they did nothing until 4.5.0, now they cause errors, so I would >>> remove them. I would also remove the 'master' lines and the 'os' >>> line. >>> >>> When 4.6.0 comes out, it is my understanding that you will not have >>> this problem, Samba will flat out refuse to start if you have the >>> idmap lines in smb.conf ;-) >>> >>> Rowland >>> >>> >> > > Put 'idmap_ldb:use rfc2307 = yes' back, you need it, the idmap lines I > was referring to, start with 'idmap config' > > Run 'net cache flush' > Ensure the libnss_winbind links exist, the 'passwd' & 'group' lines > in /etc/nsswitch.conf contain 'winbind' and PAM is set up correctly. > It may also help if you restart the DC > > Rowland > >
On Tue, 17 Jan 2017 10:04:23 -0500 Ryan Ashley via samba <samba at lists.samba.org> wrote: Firstly , 'gencache_notrans.tdb' is a cache file and is recreated when Samba is restarted.> Rowland, I was just reading over another thread on this list about the > inability to access group policy from client machines. The user did > not have the symlinks setup (I do) but one thing you mentioned was > using the NIS attributes to set UID/GID numbers for the domain. You > said we should not do this for certain users and groups, but there is > no mention of this in the guides to setting up an AD DC, so I have > always done it. We do this to make our Linux-based NAS devices work.The only only windows group that needs a gidNumber attribute is Domain Users and then only when you use the windbind 'ad' backend on a domain member. the other windows groups don't need a gidNumber, in fact, as Domain Admins needs to own directories in sysvol, you definitely shouldn't give this group a gidNumber. If you have to set up Samba this way because of your NAS, I would look closely at your NAS ;-)> > Furthermore, you recommended the user use the idmap lines to ensure > consistent UID/GID numbers across devices, yet you suggested I turn > the exact same lines off in my config. Why is this? I understand our > situations are different, but when should we set winbind to use the AD > backend and set UID/GID numbers? How do do this so Linux-base file > services can be accessed by users and come out the same?You are mixing up idmap on a DC and a Unix domain member. On a DC, idmapping is done in idmap.ldb, users & groups are allocated an xidNumber in the '3000000' range, the number allocated is on the next number available basis, apart from 'Administrator', 'Domain Users' and 'nobody' which get '0', '100' and '65534'. On a Unix domain member, the two main ways of setting up idmapping is with the winbind 'rid' and 'ad' backends. The 'rid' backends calculates an ID from the windows RID, so you don't have to add anything to AD. This means that whilst, by using the 'rid' backend, you will get the same ID on every Unix domain member, it will still be different from the ID on a DC (and the ID will probably be different on other DCs). The only way to get the same ID everywhere is to use the 'ad' backend, If you give a user a uidNumber and run 'net cache flush', this will be used instead of the xidNumber without modifying smb.conf in any way. On a Unix domain member it is different, you need to add something like this: idmap config *:backend = tdb idmap config *:range = 2000-9999 ## map ids from the domain the ranges may not overlap ! idmap config SAMDOM : backend = ad idmap config SAMDOM : schema_mode = rfc2307 idmap config SAMDOM : range = 10000-999999 Now provided that the uidNumber attributes you have added are between 10000 and 999999 AND you have given Domain users a gidNumber in the same range, getent will display info for your users. Now somebody (and I know who) recommended adding those lines to the smb.conf, but they do nothing on a DC, well they didn't until 4.5.0 came out and then they started causing errors, so bottom line, don't add them to a Samba AD DC smb.conf Rowland
The NAS in question is a QNAP. Great NAS, but it was recommended to use NIS attributes to us so we used them. How can I correct all of this since nothing can authenticate now? Start a new domain? Lead IT/IS Specialist Reach Technology FP, Inc On 01/17/2017 10:57 AM, Rowland Penny via samba wrote:> On Tue, 17 Jan 2017 10:04:23 -0500 > Ryan Ashley via samba <samba at lists.samba.org> wrote: > > Firstly , 'gencache_notrans.tdb' is a cache file and is recreated when > Samba is restarted. > >> Rowland, I was just reading over another thread on this list about the >> inability to access group policy from client machines. The user did >> not have the symlinks setup (I do) but one thing you mentioned was >> using the NIS attributes to set UID/GID numbers for the domain. You >> said we should not do this for certain users and groups, but there is >> no mention of this in the guides to setting up an AD DC, so I have >> always done it. We do this to make our Linux-based NAS devices work. > > The only only windows group that needs a gidNumber attribute is Domain > Users and then only when you use the windbind 'ad' backend on a domain > member. the other windows groups don't need a gidNumber, in fact, as > Domain Admins needs to own directories in sysvol, you definitely > shouldn't give this group a gidNumber. > If you have to set up Samba this way because of your NAS, I would look > closely at your NAS ;-) > >> >> Furthermore, you recommended the user use the idmap lines to ensure >> consistent UID/GID numbers across devices, yet you suggested I turn >> the exact same lines off in my config. Why is this? I understand our >> situations are different, but when should we set winbind to use the AD >> backend and set UID/GID numbers? How do do this so Linux-base file >> services can be accessed by users and come out the same? > > You are mixing up idmap on a DC and a Unix domain member. On a DC, > idmapping is done in idmap.ldb, users & groups are allocated an > xidNumber in the '3000000' range, the number allocated is on the next > number available basis, apart from 'Administrator', 'Domain Users' and > 'nobody' which get '0', '100' and '65534'. > > On a Unix domain member, the two main ways of setting up idmapping is > with the winbind 'rid' and 'ad' backends. The 'rid' backends calculates > an ID from the windows RID, so you don't have to add anything to AD. > This means that whilst, by using the 'rid' backend, you will get the > same ID on every Unix domain member, it will still be different from > the ID on a DC (and the ID will probably be different on other DCs). > > The only way to get the same ID everywhere is to use the 'ad' backend, > If you give a user a uidNumber and run 'net cache flush', this will be > used instead of the xidNumber without modifying smb.conf in any way. > On a Unix domain member it is different, you need to add something > like this: > > idmap config *:backend = tdb > idmap config *:range = 2000-9999 > ## map ids from the domain the ranges may not overlap ! > idmap config SAMDOM : backend = ad > idmap config SAMDOM : schema_mode = rfc2307 > idmap config SAMDOM : range = 10000-999999 > > Now provided that the uidNumber attributes you have added are between > 10000 and 999999 AND you have given Domain users a gidNumber in the > same range, getent will display info for your users. > > Now somebody (and I know who) recommended adding those lines to the > smb.conf, but they do nothing on a DC, well they didn't until 4.5.0 > came out and then they started causing errors, so bottom line, don't add > them to a Samba AD DC smb.conf > > Rowland > >
OK, so since it appears our only recourse is to build a new domain from scratch, how can we prevent this from happening again? We have several Gentoo workstations, a bunch of Windows 7 workstations, and a few NAS devices which run Linux of some flavor. How do we use NIS attributes without killing our domain? The Samba guide even has instructions for using ADUC to set the UID/GID for users and groups. You stated I should only set a GID for "Domain Users", but what about other AD security groups we create? This is a tad confusing since I thought NIS was needed for our Linux systems and the NAS devices. Lead IT/IS Specialist Reach Technology FP, Inc On 01/17/2017 10:57 AM, Rowland Penny via samba wrote:> On Tue, 17 Jan 2017 10:04:23 -0500 > Ryan Ashley via samba <samba at lists.samba.org> wrote: > > Firstly , 'gencache_notrans.tdb' is a cache file and is recreated when > Samba is restarted. > >> Rowland, I was just reading over another thread on this list about the >> inability to access group policy from client machines. The user did >> not have the symlinks setup (I do) but one thing you mentioned was >> using the NIS attributes to set UID/GID numbers for the domain. You >> said we should not do this for certain users and groups, but there is >> no mention of this in the guides to setting up an AD DC, so I have >> always done it. We do this to make our Linux-based NAS devices work. > > The only only windows group that needs a gidNumber attribute is Domain > Users and then only when you use the windbind 'ad' backend on a domain > member. the other windows groups don't need a gidNumber, in fact, as > Domain Admins needs to own directories in sysvol, you definitely > shouldn't give this group a gidNumber. > If you have to set up Samba this way because of your NAS, I would look > closely at your NAS ;-) > >> >> Furthermore, you recommended the user use the idmap lines to ensure >> consistent UID/GID numbers across devices, yet you suggested I turn >> the exact same lines off in my config. Why is this? I understand our >> situations are different, but when should we set winbind to use the AD >> backend and set UID/GID numbers? How do do this so Linux-base file >> services can be accessed by users and come out the same? > > You are mixing up idmap on a DC and a Unix domain member. On a DC, > idmapping is done in idmap.ldb, users & groups are allocated an > xidNumber in the '3000000' range, the number allocated is on the next > number available basis, apart from 'Administrator', 'Domain Users' and > 'nobody' which get '0', '100' and '65534'. > > On a Unix domain member, the two main ways of setting up idmapping is > with the winbind 'rid' and 'ad' backends. The 'rid' backends calculates > an ID from the windows RID, so you don't have to add anything to AD. > This means that whilst, by using the 'rid' backend, you will get the > same ID on every Unix domain member, it will still be different from > the ID on a DC (and the ID will probably be different on other DCs). > > The only way to get the same ID everywhere is to use the 'ad' backend, > If you give a user a uidNumber and run 'net cache flush', this will be > used instead of the xidNumber without modifying smb.conf in any way. > On a Unix domain member it is different, you need to add something > like this: > > idmap config *:backend = tdb > idmap config *:range = 2000-9999 > ## map ids from the domain the ranges may not overlap ! > idmap config SAMDOM : backend = ad > idmap config SAMDOM : schema_mode = rfc2307 > idmap config SAMDOM : range = 10000-999999 > > Now provided that the uidNumber attributes you have added are between > 10000 and 999999 AND you have given Domain users a gidNumber in the > same range, getent will display info for your users. > > Now somebody (and I know who) recommended adding those lines to the > smb.conf, but they do nothing on a DC, well they didn't until 4.5.0 > came out and then they started causing errors, so bottom line, don't add > them to a Samba AD DC smb.conf > > Rowland > >