Tech

Guides
 

Join a Linux server to Active Directory with Samba 3.0

By Scott Lowe MCSE, Special to ZDNet Asia
Thursday, October 10, 2002 12:00 PM

Windows 2000 and Active Directory wreaked some havoc with Samba 2. But developers have been working hard on Samba 3, which overcomes the AD hurdle. Get a sneak preview of the new file and authentication freeware solution.

As Linux becomes more prevalent in enterprises, the need for interoperability between it and incumbent operating systems becomes more important. After all, nobody wants to add a new system if it will require a whole new set of administration tools and additional user accounts.

One tool that has become ubiquitous in Linux configurations is Samba, the open source 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. Some administrators want to move to a native mode Active Directory domain but still provide a central authentication service, so a new way to handle authentication needs to be devised.

Enter Samba 3.0. The Samba team is providing the means to handle this very task in it newest version, which is still under development. I’m going to show you how to use the latest alpha version of Samba to allow your Linux server to authenticate against a Windows 2000 domain controller.

From alpha to final code
This article employs the latest alpha version of Samba 3.0. Although not ready for production networks, the alpha code does work and, according to the road map, 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 article are not likely to change.

What you need
To get Samba 3.0 up and running, you must have:
  • Windows 2000 Server acting as a domain controller.
  • The OpenLDAP development libraries for Linux. As of this writing, version 2.0.23-4 is the latest release and can be downloaded here.
  • The MIT Kerberos development libraries for Linux. As of this writing, these libraries are at version 1.2.4-1. krb5-devel can be downloaded here; \\krb5-libs can be downloaded here; and krb5-workstation can be downloaded here.
  • The latest version of the Samba alpha code. (I chose not to get the CVS version.) As of this writing, build 17 of the Samba code was the latest and can be downloaded here.

If you’re not sure whether you have these libraries installed, you can use the RPM command to find out. Use the rpm -qa |grep openldap command to see whether 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 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 article will be:
Win2K - 10.109.10.133
Linux - 10.109.10.132


Installing Samba 3.0
The installation of Samba 3.0 is fairly straightforward. Follow these steps:
  1. Expand the Samba 3.0 distribution with the command gunzip -cd samba-3.0-alpha17.tar.gz | tar xvf -.
  2. Switch to the source directory of the newly created directory with the command cd samba-3.0-alpha17/source.
  3. Run the configuration script, using the command /configure -prefix=/usr/local/samba to instruct the script to install Samba into /usr/local/samba.
  4. Make sure that the lines #define HAVE KRB5 1 and #define HAVE LDAP 1 are present in the include/config.h file.
  5. Compile the application with the make command.
  6. Install the application with the make install command.

Configuring Kerberos
You need to configure some parameters to let the Kerberos process know how to handle the Active Directory server. Listing A shows the entire contents of my /etc/krb5.conf file. Make the appropriate modifications to your configuration, keeping in mind that case matters to Kerberos; SLOWE.COM and slowe.com do not match.

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 easy to troubleshoot because you will be greeted with kinit(v5): Clock skew too great while getting initial credentials when you test Kerberos.

To make sure that your connection is working, run the command /usr/kerberos/bin/kinit nuser@SLOWE.COM. The Kerberos kinit command will test communication between your servers. The syntax is kinit user@REALM, where REALM is your Active Directory domain name and must be uppercase. If you do not use all uppercase for the realm, you’ll receive this error:
kinit(v5): Cannot find KDC for requested realm while getting initial credentials.

If communication is working, you’ll be prompted for the user password. When entered correctly, you’ll simply come back to a bash prompt. If entered incorrectly, you’ll receive the error: kinit(v5): Preauthentication failed while getting initial credentials.



WORTHWHILE?

0

0 votes
Blog

Talkback 10 comments

The Samba Road Map URL is: (web link)

I have installed Samba 2.0.6 on FreeBSD 4.4 - works great! It comes with the Ports collection.
Posted by Dwight Walker on Monday, November 18 2002 12:10 PM

I am getting an error when I run "/etc/samba/bin/net ads join" . I get an "Segmentation fault" error.
I can run "/usr/kerberos/bin/kinit administrator@BPBLDAP.CO.ZA" and it works.
I have got no idea what could be wrong. Please help.

Luis Lourenco
Affinity Logic
+27 11 797 0338
+27 82 960 9749
luis.lourenco@affinity.co.za
Posted by Luis Lourenco on Friday, March 14 2003 07:34 PM

How do u deploy a network storage for an organization using openAFS, keberous 5, NTP, openLDAP and ISC BIND in a linux server with windows desktop machines as client?
Posted by Ikemesit Ibok on Thursday, March 20 2003 10:49 PM

We are using this tutorial to install samba 3.0. The Listings A and B, linked in the text are defective. It would be great if you could provide us with these listings or fix the links.

Thanks in advance.

Sincerly

Andreas Bollhalder
Posted by Andreas Bollhalder on Wednesday, June 18 2003 09:58 PM

I used this document to join our Linux server to Active Directory and it worked very well. The only problem is that soon after setting up the krb5.conf with domain information, Windows NT 4.0 workstations were not able to login to our Windows 2000 domain controller. XP Pro machines were fine. I had to unplug the Linux box in order for them to login. I only want to use the Windows server as the domain controller. Why did this happen? Any help or suggestions would be greatly appreciated.
Scott
Posted by Scott Gravning on Friday, November 07 2003 05:27 AM

Has anybody succesfully implemented a Samba server on a 2003 ADS ?
I'm battling very hard on this side
Posted by Nic on Thursday, January 15 2004 11:11 PM

I have struggling to configure samba. i am using Knoppix linux server and win 2000 worstation. I am a novice in sys admin and linux. can someone help.
Posted by Derick on Tuesday, March 23 2004 10:14 PM

Samba vs. Active Directory - software deployment.

There are some concerns about Samba that it doesn't support software deployment, and Active Directory does.
It is not true.

Active Directory can only deploy software that is available in MSI format, which is rare - most installers are in EXE format.
So Active Directory is not that good for software deployment.

With Samba, you can distribute software in many formats (MSI, EXE, other) with a tool called WPKG - it is GPL and can be downloaded from (web link)

You can use WPKG with Active Directory, too.
Posted by anonymous on Saturday, July 02 2005 08:14 PM

Geez... Plz fix the links in text. Theory is easy ;) but in these files many small things can go wrong.
Posted by anonymous on Monday, October 03 2005 10:18 PM

>Active Directory can only deploy >software that is available in MSI >format, which is rare - most installers >are in EXE format.

What a load of garbage. Almost all software for Windows is in MSI format. Enterprises with any brains will be repackaging anything into MSI if it isn't already in that format.
Posted by anonymous on Monday, February 27 2006 06:25 PM

Guest user

Guest user

Level: 
Joined: —
Already a member? Log in »



 

Loading...

Whitepapers / Case Studies

Downloads

Network Administration News


Tech Jobs Now!

Tags

  1. availability
  2. data
  3. directory
  4. do
  5. documents
  6. double-take
  7. e-mail
  8. excel
  9. feature
  10. field
  11. formatting
  12. high
  13. list
  14. management
  15. microsoft
  16. page
  17. project
  18. security
  19. server
  20. service
  21. services
  22. should
  23. simply
  24. sql
  25. time
  26. tips
  27. use
  28. using
  29. windows
  30. word