Join Linux to Active Directory with Samba 3.0

Daily Newsletters

Sign up to ZDNet UK's daily newsletter.

ANALYSIS
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 authorisation product. With Windows NT and Samba version 2.2.x, it had become easy to integrate a Linux server into a Microsoft environment, but the release of Windows 2000 and its use of Active Directory made it more complicated. 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 uses Active Directory with the Kerberos authentication protocol (as does XP), 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 stabilisation 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 synchronisation 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.

Talkback

very nice

SHO SAAB 7 September, 2010 18:59
Reply

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

Moley

@kevinmchapman. OK, I acknowledge that 'most' was a gratuitous throwaway comment as an afterthought and too presumptuous. As to proof, as you...

3 hours ago by Moley on A tale of two distros: Ubuntu and Linux Mint
Jack Schofield

@BrownieBoy > Works really well for thieves.... >> Nice attempt to deflect the argument by tossing in a point that's totally >> irrelevant, even...

4 hours ago by Jack Schofield on AMD Ultrathins to challenge Intel Ultrabooks
raskolnikof

fantastic that the so called piracy bills have been withdrawn. however, these anti-democracy supporters are still in the shadows so lets be alert...

5 hours ago by raskolnikof on SOPA, Protect IP support wavers in face of online protest
Tony Douglas

Please God no; teach them anything you like - thinking rationally, the uses and misuses of data, what data is and what it's not - but leave the...

7 hours ago by Tony Douglas via Facebook on Kids are the future. Teach ’em to code.
BrownieBoy

@Jack, > Works really well for thieves.... Nice attempt to deflect the argument by tossing in a point that's totally irrelevant, even it were...

21 hours ago by BrownieBoy on AMD Ultrathins to challenge Intel Ultrabooks
bootlegger

Make that 13 people now - I got refused today at Manchester airport. I thought I was up to date on this legislation - I knew of the EU ruling from...

1 day ago by bootlegger on UK airport body scans will not be opt out
tinycg

Don't forget to check out apps like GoodReader or SlideShark either, they're indispensible for people on the go in presentation situations. Best...

1 day ago by tinycg on Four top iPad apps for people on the move
TerryRK

Well it seems there is something a number of us agree on. Why is the Ubuntu Unity launcher so ugly? I thought perhaps it was something to do with...

1 day ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Freebies202

Duplicate comments are not made intentionally. Its very good to know that now you are keeping check on this problem because sometimes a commenter...

2 days ago by Freebies202 on Microsoft fixes blog comments, speeds up blogs with open source
kevinmchapman

"the very significant number of users" and "many (most) of us" - you have no evidence for these statements. It is a fact that most users are saying...

2 days ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
Marg Menzies Harrison

Another grammar faux pas is the improper use of "you". When sitting down down in a restaurant, for example, I get cringe when the waitress...

2 days ago by Marg Menzies Harrison via Facebook on 10 flagrant grammar mistakes that make you look stupid
zdnetukuser

And NOW, folks, for Canonical's next trick... Kubuntu is late. Here's a pencil. Draw your own conclusions. cf.:...

2 days ago by zdnetukuser on Linux Minterface
Moley

@kevinmchapman. The discussion here reflects the very significant number of users who really do like the traditional menu system and who wish to...

2 days ago by Moley on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

Er, no... It is an efficient means of finding the application/file/setting you need in one place. The icons are a simply a fallback for when you...

2 days ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

Isn't the provision of a text based search an admission by the developers that the mass of icons approach does not work? I don't need to use a...

2 days ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

"Unity and GNOME 3 both abandon the old text-based cascading menus in favour of a graphical icon-driven system." Point truly missed. Both use a...

2 days ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

whs001 - Thank you, I'm glad you liked the article. I absolutely agree with you on your first point. I should perhaps have made it clearer that...

2 days ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Dennis Nilsson

If we allow corporate interest to dictate the way our government circumvents due process against foreign entities then we should accept the same...

2 days ago by Dennis Nilsson via Facebook on ACTA stumbles in Germany
GHar123

I totally dislike pirating of works, I fear that artists will be deterred from creating works if they think that they are going to get ripped off....

2 days ago by GHar123 on ACTA stumbles in Germany
JCB33

How dare film makers, artists or anybody that invests in creativity stop us pirating their works for free. I want to be able to walk into my local...

3 days ago by JCB33 on ACTA stumbles in Germany

Latest in Application Development