Authenticating UNIX/Linux to Windows 2008R2. Part 1
Background
Prior to using Windows, UNIX (eg Solaris) managed users and groups using /etc/passwd, /etc/group files, or using NIS or NIS+. Since Solaris 8, NIS+ was deprecated, with LDAP being the preferred authentication method.
However, whilst Windows 2008R2 Active Directory does act as a LDAP server, it doesn't provide any authentication. Authentication is done via Kerberos/V5. This blog will document the steps required to set up Windows 2008R2 to act as a Kerberos and LDAP server to support both Linux and Solaris.
VMware Workstation will be used to do the Proof-of-concept. It is expected that the SPARC version of Solaris 10 would act the same as the Intel version of Solaris 10.
The following Guest UNIX Operating systems will be tested:
- Solaris 10 Update 9, (x86_64)
- Red Hat Enterprise Linux 5 Update 6 (x86_64)
- Red Hat Enterprise Linux 6 (x86_64)
Windows 2008R2 (x64) Standard Edition will be used.
Requirements
- VMware Workstation 7.1.4 used as the proof-of-concept hosting platform.
- Active Directory must be the source of truth.
- Windows 2008R2 will also provide DNS.
- No Additional self-supported software allowed.
- Configuration files may be edited and documented (eg pam.conf)
- Encryption must be used (ie LDAPS, not LDAP).
- Certificates must be used to provide positive authentication of servers (to prevent spoofing). This applies to both LDAP and Kerberos.
- Users must be able to manage their own passwords (ie this isn't password synchronisation).
- Password expiry controls must be honoured.
- Kerberos features, such as single sign on (from Windows to UNIX, or UNIX to UNIX) must be supported.
Network and Host IP Addresses
- Subnet: 192.168.102.0/24
- Default Router: None
- DNS Domain: example.com
- Kerberos Realm: EXAMPLE.COM
- AD server hostname: adserver.example.com
- AD server IP address: 192.168.102.10
- Solaris guest 1 hostname: sol10host1.example.com
- Solaris guest 1 IP address: 192.168.102.20
- Solaris guest 2 hostname: sol10host2.example.com
- Solaris guest 2 IP address: 192.168.102.30
- RHEL5.6 guest 1 hostname: rhel5host1.example.com
- RHEL5.6 guest 1 IP address: 192.168.102.40
- RHEL5.6 guest 2 hostname: rhel5host2.example.com
- RHEL5.6 guest 2 IP address: 192.168.102.50
- RHEL6.0 guest 1 hostname: rhel6host1.example.com
- RHEL6.0 guest 1 IP address: 192.168.102.60
- RHEL6.0 guest 2 hostname: rhel6host2.example.com
- RHEL6.0 guest 2 IP address: 192.168.102.70
Method
Windows Setup
- Create a Windows 2008R2 VM, with the following configuration:
- Custom Config, VMware Workstation 6.5 compatible
- I will install the operating system later.
- Guest OS : Microsoft Windows, Windows Server 2008 R2 x64
- VM Name: "adserver"
- 1 Processor, 1 Core per Processor
- 1024MB Memory
- Use Host-Only Networking
- IDE Controller type: ATAPI
- SCSI Controller type: LSI Logic SAS
- Disk: Create a new virtual disk, SCSI, Maximum Disk size, 40GB, Store as Single File, adserver.vmdk (on an NTFS filesystem).
- Insert the Windows installer CD (build 59754),
- Power on and Boot from CD.
- Install Windows 2008R2:
- Select English Language, English (Australian) Time/Currency, US Keyboard
- Install Now
- Select Windows 2008 R2 Standard (Full Installation)
- Accept the License Terms
- Select Custom->Advanced
- Select Drive 0, Unallocated Space
- Set hostname, timezone,
- Install VMware Tools. Use Typical Setup.
- Set VMware tools to use Time Synchronisation between the VM and the host.
- Reboot
- Configure Networking, using Static IPv4 address. Disable IPv6.
- Allow Remote Desktop, if required
- Disable Firewall
- Install AD Server Role, run "dcpromo"
- Advanced Mode Installation: yes
- New domain in a new forest: yes
- Domain FQDN: example.com
- Domain NETBIOS name: EXAMPLE
- Forest Functional Level: Windows Server 2008 R2
- Select the DNS Server Additional Option
- Use the standard folder names
- Enter a Directory Services Restore Mode Administrator Password
- Reboot
- Set the nameserver (same as parent folder) NS to use the FQDN. "adserver.example.com."
- Set the nameserver for the Network Connection to "127.0.0.1"
- Set the DNS suffix for this connection to "example.com"
- Install the Identity Management for UNIX Role Service
- Install the Active Directory Certificate Services Role:
- Install just the Certificate Authority
- Setup Type : Enterprise
- CA Type: Root CA
- Private Key : Create a new private key
- Cryptographic Service Provider : RSA (default)
- Key Length : 2048 (default)
- Hashing Algorithm: SHA1 (default)
- Common Name for the CA : example-ADSERVER-CA
- Distinguished Name Suffix : DC=example,DC=com
- Validity Period : 5 Years
- Start Active Directory Users and Computers
- Create a user for doing LDAP bind (anonymous binds are not supported):
- Name the user
(eg. "ldapsearch"). - Set the password:
(eg "ld@p53arch") - Set the user password to never expire, and not be changeable.
- The user must be a member of "Domain Users" (by default, it is).
- Name the user
- Create an OU, if required to contain UNIX objects,
(eg. "OU=UNIX,DC=example,DC=com"). - Create UNIX groups, as required:
- Create a Global Security Group. Name the group
(eg. "unixgrp1″). - Select the properties, UNIX Attibutes tab, and set as follows:
- NIS Domain: EXAMPLE
- GID: 10000
- Primary Group: 10000
- Create a Global Security Group. Name the group
- Create UNIX users, as required:
- Name the user, and give it a password.
- Select the properties, UNIX Attibutes tab, and set as follows:
- NIS Domain: EXAMPLE
- UID: 10000
- Login Shell: /bin/bash
- Home Directory: /home/unix1
- Primary Group: unixgrp1
- Using DNS Management, Add DNS entries for the hosts.
Create A record, and PTR record - Start Certificate Services (certsrv.msc), and export the certificate for "example-ADSERVER-CA":
- Select Base-64 encoding X.509 (.CER)
- Save the file to "rootCA.cer".
- Start Active Directory Users and Computers
- Create a computer object for each host. This will be used to map Kerberos host principals to a user.