Professional Documents
Culture Documents
(Samba) Join A Linux Server To Active Directory With Samba 3
(Samba) Join A Linux Server To Active Directory With Samba 3
(Samba) Join A Linux Server To Active Directory With Samba 3
com (press
control & click here)
One tool that has become ubiquitous in Linux configurations is Samba, the
freeware file services and authorization software. The release of Windows
2000 and its use of Active Directory complicated integrating a Linux server in
a Microsoft environment, which had become a snap with Windows NT and
Samba version 2.2.x. Although Samba can still be used as a domain
controller, it requires a mixed-mode Windows 2000 domain, in which some
Windows NT 4.0 domain controllers are still present (Samba is considered a
Windows NT 4.0 domain controller).
In addition, Windows 2000 (and XP) uses Active Directory with the Kerberos
authentication protocol, which presents new challenges for interoperability.
With some administrators’ desire to move to a native mode Active Directory
domain, but still provide a central authentication service, a new way needs to
be devised to handle authentication.
Enter Samba 3.0. The Samba team is providing the means to handle exactly
this task in it newest version, which is still under heavy development. In this
Daily Drill Down, I’ll show you how to use the latest alpha version of Samba to
allow your Linux server to authenticate against a Windows 2000 domain
controller.
Alpha to Omega
This Daily Drill Down employs the latest alpha version of Samba 3.0. Although
not ready for production networks, the alpha code does work and, according
to the roadmap, will not drastically change when the full public release is
ready. After a lengthy chat with the Samba development team, I was
reassured that coming changes to Samba 3.0 (from alpha to the final release)
will primarily be the addition of features and the stabilization of the code. The
installation and configurations shown in this Daily Drill Down, however, are not
likely to change.
If you’re not sure if you have these libraries installed, you can use the RPM
command to find out. Use the rpm -qa |grep openldap command to see if you
have the openldap-devel library and use rpm –qa | grep krb to check for the
Kerberos libraries. If you are missing any of these libraries, install them with
the rpm –i libraryname command. The only library that I was missing in my
default Red Hat Linux 7.3 installation was the krb5-workstation library.
IP addresses
The IP addresses of the machines used in this Daily Drill Down will be:
Win2k - 10.109.10.133
Linux - 10.109.10.132
You have one more thing to check. While it might sound trivial, I cannot stress
enough the importance of clock synchronization between your Windows 2000
Server and your Linux server. If the time is off by more than five minutes, the
two servers will be able to communicate, but no ticket information will work.
This is very easy to troubleshoot because you will be greeted with kinit(v5):
.Clock skew too great while getting initial credentials when you test Kerberos
Configuring Samba
Once installation is complete, you need to create a Samba configuration file.
Samba uses the file /usr/local/samba/lib/smb.conf for its configuration
parameters. To begin, I’ll set up a very minimal configuration file that looks
:like
realm = SLOWE.COM
ads server = 10.109.10.133
security = ADS
encrypt passwords = yes
In this configuration file, the realm statement sets the Kerberos realm
information. This is analogous to a domain name and has to be all uppercase.
The ads server statement is the resolvable name or the IP address of your
Windows 2000 domain controller server. I chose to use the IP address to
remove the possibility of any DNS issues. The security statement tells Samba
to use Active Directory security. Finally, the encrypt passwords statement tells
Samba that passwords need to be encrypted to work with the Kerberos
.protocol
To make sure the process worked, go to your Windows 2000 Server, open
Active Directory Users and Computers, and look at the entries. If the above
step worked, you’ll see an entry in this list with the name of your Linux server.
.My Linux server is named ldaps and now appears in the list
Testing it
On your Linux machine, you should be able to connect to Windows shares
using Samba’s smbclient without the need for a password (thanks to
Kerberos). To test this, enter the /usr/local/samba/bin/smbclient //w2k/c\$ -k
.command at the Linux prompt
Since this is still an alpha version of Samba 3.0, you’ll see a number of errors
scroll by, but this command still works. You’ll finally be connected to the C$
.administrative share on your Windows 2000 Server