Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


December 2007

LDAP Authentication

Configure UNIX and Linux clients to use Active Directory
RSS
Subscribe to Windows IT Pro | See More Active Directory (AD) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
SideBar    LDAP Limitations

Download the Code Here

Executive Summary:

Microsoft Windows Server 2003 R2’s Identity Management for UNIX feature and Microsoft Windows Server 2003’s Services for UNIX (SFU) 3.5 let you use Active Directory (AD) to integrate UNIX and Linux clients into a Windows operating system (OS) environment. Identity Management for UNIX and SFU let your AD domain controllers (DCs) act as Network Information Service (NIS) Master and Slave servers and let your UNIX and Linux clients act as NIS clients. However, Lightweight Directory Access Protocol (LDAP) offers a more secure alternative than NIS. Learn how to implement LDAP in a UNIX/Linux environment.


Problem:
NIS is an easy solution for integrating UNIX and Linux clients into a Windows environment, but it lacks security.

Solution:
Configure UNIX and Linux clients to use AD for LDAP authentication. what you need: Windows 2003 R2, LDAP, AD DCs, UNIX or Linux

Difficulty: 4 out of 5

In “Integrating Windows with UNIX/Linux” and “Migrating NIS Domains”, I explain how to use Windows Server 2003 R2’s Identity Management for UNIX feature (or Windows 2003’s Services for UNIX—SFU—3.5) to easily integrate UNIX and Linux clients into a Windows environment, using Active Directory (AD) as the authentication store for user accounts. Identity Management for UNIX and SFU let your AD domain controllers (DCs) act as Network Information Service (NIS) Master and Slave servers and let your UNIX and Linux clients act as NIS clients. Depending on your configuration, users can use one set of credentials to log on to both Windows and UNIX/Linux clients.

Although NIS is easy to set up and configure, many administrators prefer not to use it because of past security problems or because NIS isn’t secure enough for their enterprise (especially if they use the UNIX crypt method instead of MD5 to protect passwords). UNIX vendors such as Sun Microsystems are moving away from NIS, instead favoring LDAP for authenticating users and accessing system-related data. Many security administrators believe LDAP is a more secure alternative than NIS. LDAP requires the use of a central directory on an LDAP server, which stores user and computer data. Most modern UNIX and Linux distributions support LDAP, AD can impersonate an LDAP directory, and each DC functions as an LDAP server. In this article I explain how to configure UNIX and Linux clients to use Windows 2003 R2-based AD as an LDAP authentication solution. Although you can use Windows 2003-based AD and SFU for LDAP integration, I don’t discuss this solution. Nor do I discuss using AD to store information about hosts, services, protocols, etc., for use by UNIX and Linux hosts. (For information about using Windows 2003 with SFU, try searching the Microsoft TechNet Web site at technet.microsoft.com/en-us/default.aspx.)

Getting Started
Before UNIX and Linux clients can use AD for authentication, you need to configure your Windows and AD environment. First, you must ensure that your UNIX and Linux clients have network connectivity to the AD DCs they’ll use as LDAP servers. I recommend that you use standard network diagnostic tools such as Ping and Nslookup. If you aren’t already doing so, use your Windows DNS servers as the DNS servers for your UNIX and Linux clients as well.

Next, you need to raise your AD domain functional level to Windows 2003. From a DC, run the Microsoft Management Console (MMC) Active Directory Users and Computers snap-in (dsa.msc from the command line), right-click the name of your domain, and select Raise Domain Functional Level from the context-sensitive menu.

The next step is counterintuitive. If you haven’t already done so, you need to install the Identity Management for UNIX feature on at least one Windows 2003 R2 DC, and configure Server for NIS. Although you won’t be using NIS, installing this optional software extends your forest’s schema with necessary classes and attributes that support your UNIX and Linux-based users, as well as extends the Active Directory Users and Computers snap-in to manage them.

Then, install the necessary software, as I describe in “Integrating Windows with UNIX/Linux” (techxworld.com/community/blogs/features/archive/2007/05/02/integrating-windows-with-unix-linux.aspx), and configure NIS domains that represent your Windows domains. (You don’t need to follow the instructions to configure NIS on your UNIX and Linux clients.) Installing Identity Management for UNIX on every DC is unnecessary, but I recommend installation on several DCs, to ensure that the Active Directory Users and Computers extensions are available to domain administrators.

After configuring Server for NIS, you should use the MMC Services snap-in (services.msc from the command line) to disable this service on each DC on which you installed it. Right-click Server for NIS, select Properties, and select Disabled from the Startup Type drop-down list. If the service is running, click Stop. Click Apply, OK to close the dialog box. Disabling and stopping Server for NIS prevents a user from joining a UNIX system to the NIS domain that represents your Windows domain.

Next, follow the instructions in “Integrating Windows with UNIX/Linux” (techxworld.com/community/blogs/features/archive/2007/05/02/integrating-windows-with-unix-linux.aspx) to configure the groups and user accounts that will be used by UNIX and Linux users, placing each into an NIS domain; assigning them a user ID (UID), login shell, and home directory; and placing them into a primary group (group ID—GID). Because of the differences in how various versions of UNIX and Linux use an LDAP server for authentication, I recommend that you place all of your UNIX and Linux users into one AD organizational unit (OU) or container.

Finally, create a user account called a proxy account. This account needs no special permissions or privileges on the DCs; it will be used to perform directory searches and lookups. Configure the account so that the password never expires and can’t be changed.

Solution Steps:
  1. Ensure that your UNIX and Linux clients have network connectivity to the AD DCs they’ll use as LDAP servers.
  2. Raise your AD domain functional level to Windows 2003.
  3. Install the Identity Management for UNIX feature and configure Server for NIS.
  4. Configure NIS domains that represent your Windows domains (although you won’t use NIS).
  5. Configure the groups and user accounts that will be used by UNIX and Linux users.
  6. Create a user account called a proxy account to perform directory searches and lookups.
  7. Obtain an SSL certificate for every DC that will be used by UNIX and Linux clients for authentication.
  8. Install Certificate Services to create an enterprise root CA.
  9. Configure your UNIX and Linux clients to use AD LDAP.

LDAP Security
Before you can configure UNIX and Linux clients to use LDAP as an authentication method, you need to be aware of potential security problems and make the necessary changes to your Windows environment. When users are authenticated on UNIX and Linux clients, those clients attempt to connect to LDAP servers and authenticate using the credentials provided by the users. If authentication to the LDAP server is successful, the user is authenticated to the UNIX or Linux client and his or her user information (e.g., home directory, UID) is downloaded.

The first issue is that many LDAP servers permit a client to bind (the LDAP term for authenticate) as an anonymous user and provide access to the information stored in the LDAP directory. Windows 2003 disables anonymous binding except in limited circumstances. Although you can permit clients to bind anonymously, I advise against this practice. If users can bind anonymously, they can search the directory looking for information that can be used to launch attacks against systems and networks. Instead, you need to create a proxy account (as I discuss in the previous section) that’s used by UNIX and Linux clients to bind to your DCs, so they can search the directory for user account information.

The second issue is that when clients bind to an LDAP server they can, and often do, send credentials in clear text. Anyone with a packet sniffer can see credentials pass over the network. The solution is to use Secure Sockets Layer (SSL) to encrypt the network communications between UNIX and Linux clients and LDAP servers. Before you can use SSL for secure communications, each LDAP server must have an SSL certificate issued by a Certification Authority (CA) that’s trusted by both the client and server. Thus, you need a certificate for every DC that will be used by UNIX and Linux clients for authentication. You can purchase SSL certificates from a number of public CAs, or you can install and use Microsoft’s Certificate Services. I recommend the latter option.

Use Certificate Services to create an enterprise root CA. Installing Certificate Services is relatively easy because you don’t need to purchase additional software or certificates. In addition, features such as autoenrollment make deployment of certificates that can enable LDAP over SSL (LDAPS) automatic.

Client Configuration
Although some UNIX and Linux systems let you configure LDAP as an authentication method when you install them, I recommend that you use the following instructions to configure LDAP after system installation. The instructions I provide, which highlight three common UNIX and Linux variants (i.e., Solaris 10, FreeBSD 6.2, and openSUSE 10.2), also work for previously installed systems. Configuring LDAP on alternative UNIX/Linux versions is similar also.

Solaris systems. Although Solaris 10 supports the use of LDAP for user authentication in the OS out-of-the-box, configuration is somewhat involved. The first step is to create a certificate store that will be used by LDAP, and install the root certificate of the CA that issued the SSL certificate used to enable LDAPS on DCs that will function as LDAP servers. The following commands should be run by root to accomplish this step. You need a file containing the Base64-encoded certificate of the root CA.

/usr/sfw/bin/certutil -N -d /var/ldap chmod 444 /var/ldap/* /usr/sfw/bin/certutil -A -n “<Display name of root CA certificate>” -i </path/to/certificate> -t CT -d /var/ ldap

Next, run the following command to test LDAPS connectivity between your Solaris systems and each of your DCs:

ldapsearch -p 636 -h <FQDN> -P /var/ldap/ cert8.db -D cn=administrator,cn=users,dc=contoso, dc=com -w - -b dc=contoso,dc=com -v -s base ‘(objectclass=*)’

Replace FQDN with the Fully Qualified Domain Name (FQDN) of the DC. The command assumes that your administrator account is in the default location in AD (i.e., the Users container under your domain). Replace all instances of dc=contoso,dc=com with the appropriate information for your domain. For example, if your domain is corp .fabrikam.local, you would use dc=corp,dc= fabrikam,dc=local. If the command runs successfully, the output will show configuration data for the domain.

   Previous  [1]  2  Next 


Reader Comments
Mac OS 10.+ is based on unix. Will these comand work as well? Thank you.

dzoquier January 02, 2008 (Article Rating: )


Yes, the commands will work. MacOS X is based on FreeBSD, so you will want to follow those instructions. However, there are other options for MacOS X, such as the Directory Access utility.

jhowie January 10, 2008 (Article Rating: )


Dear John Howie, I am very interested in your article and trying to follow the instructions, but with regret I notice the link to your article "http://techxworld.com/community/blogs/features/archive/2007/05/02/integrating-windows-withunix-linux.aspx" is not working any more. Is there another spot I could read this?
With regards,
Camiel

camielb January 17, 2008 (Article Rating: )


where is web listing?
////
Reader from Thailand

suwaschai January 17, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Microsoft: Save Money ... By Paying for Software

Microsoft this week adopted an interesting tactic in its long-running battle with open source software: Businesses looking to save money over the long haul should simply pay for software instead of moving to free, open source solutions. The rationale? ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Microsoft Delivers Service Pack 2 Beta 2 for Vista, Server 2008

Microsoft on Tuesday announced the availability of the Beta 2 version of Service Pack 2 (SP2) for Windows Vista and Windows Server 2008. Since both operating systems were developed from the same code base, they have a common servicing structure and thus ...


Related Articles Windows Server 2003 Certificate Services

Securing Communications with Certificate Services

Active Directory (AD) Whitepapers Sustainable Compliance: How to reconnect compliance, security and business goals

Managing Unix/Linux with Microsoft System Center Operations Manager 2007 Cross Platform Extensions Beta

Addressing the Insider Threat with NetIQ Security and Administration Solutions

Related Events Concrete Ways to Make Sure Your SharePoint Deployment Doesn't Blow Up

PCI Requirements for Windows and Active Directory: Straight from a Certified Auditor

Check out our list of Free Email Newsletters!

Active Directory (AD) eBooks Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Windows 2003: Active Directory Administration Essentials

Related Active Directory (AD) Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing