Apr 152014

I have been using Samba 3 for years… used it as a PDC for Windows XP to Windows 7. I principally use it to get my Unix/Linux (NIS/YP) users the ability to log in to the Windows box. I was willing to give Samba 4 a try. I wanted to use it as a PDC, now called AD/DC (Active Directory/Domain Controler), to permit login into Windows 8.x PC. So here his the story of the download of Samba 4.1.x source – it’s compilation and it’s configuration on RHEL 6.5.

Before I continue my story on Linux, I need to say that I tried it on my Solaris server… I was never able to fully compile nor make it run… it has so many errors but this is another story.

So for now here is the Linux procedure I used. After the download I wanted to compile and configured Samba 4 and I first found out about requirements (https://wiki.samba.org/index.php/Samba_4/OS_Requirements)
Then I configured it like this:

./configure –prefix=/opt/samba-4.1.11 \
–with-privatedir=/opt/samba-4.1.11/etc \
–with-configdir=/opt/samba-4.1.11/etc \
–datadir=/opt/samba-4.1.11/doc \
–with-statedir=/opt/samba-4.1.11/var/locks \
–with-cachedir=/opt/samba-4.1.11/var/locks \
–with-automount \
–enable-debug \
–enable-selftest

Then issued ” make -j 25 ” no errors… then ” make install ” still no errors.

Fallowing instruction from https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO I tryed to provision my new domain… but it failed.

From version 4.1.6 to 4.1.11 it was similar.

[root@srvgrm07:/opt/samba-4.1.6/bin ]% ./samba-tool domain provision –use-rfc2307 –interactive
Realm [MY.DOMAIN.CC]:
Domain [MY]: MY2M
Server Role (dc, member, standalone) [dc]:
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:
DNS forwarder IP address (write ‘none’ to disable forwarding) [127.0.0.1]:
Administrator password:
Retype password:
ERROR(<type ‘exceptions.KeyError’>): uncaught exception – “Unable to find user/group in [‘users’, ‘users’, ‘other’, ‘staff’]”
File “/opt/samba-4.1.6/lib64/python2.6/site-packages/samba/netcmd/__init__.py”, line 175, in _run
return self.run(*args, **kwargs)
File “/opt/samba-4.1.6/lib64/python2.6/site-packages/samba/netcmd/domain.py”, line 398, in run
use_rfc2307=use_rfc2307, skip_sysvolacl=False)
File “/opt/samba-4.1.6/lib64/python2.6/site-packages/samba/provision/__init__.py”, line 1928, in provision
users_gid = findnss_gid([users or “users”, ‘users’, ‘other’, ‘staff’])
File “/opt/samba-4.1.6/lib64/python2.6/site-packages/samba/provision/__init__.py”, line 511, in
findnss_gid = lambda names: findnss(grp.getgrnam, names)[2]
File “/opt/samba-4.1.6/lib64/python2.6/site-packages/samba/provision/__init__.py”, line 507, in findnss
raise KeyError(“Unable to find user/group in %r” % names)

What was that ? To fix this I simply added a group called “staff” to /etc/group
echo “staff:x:51:john,smith” >> /etc/group

Note:No standard staff group is normally defined on RHEL 5.x or 6.x I checked. On Solaris it was GID 10, on Debian it is GID 50 (but used for ftp on RHEL) so I decided and randomly piked GID 51 !

It finally worked as expedted.

[root@server:/opt/samba-4.1.6/bin ]% ./samba-tool domain provision –use-rfc2307 –interactive
Realm [MY.DOMAIN.CC]:
Domain [MY]: MY2M
Server Role (dc, member, standalone) [dc]:
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:
DNS forwarder IP address (write ‘none’ to disable forwarding) [127.0.0.1]:
Administrator password:
Retype password:
Looking up IPv4 addresses
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=my,DC=domain,DC=cc
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=grm,DC=polymtl,DC=ca
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba 4 has been generated at /opt/samba-4.1.6/etc/krb5.conf
Setting up fake yp server settings
Once the above files are installed, your Samba4 server will be ready to use
Server Role: active directory domain controller
Hostname: srvgrm07
NetBIOS Domain:     MY2M
DNS Domain:      my.domain.cc
DOMAIN SID:     S-1-5-21-4050901472-1423721178-3131220093

So I am still experimenting… I will get back to you soon !

Rejean.

Leave a Reply

(required)

(required)