Microsoft Active Directory and Linux
For the Western Michigan University Computer Club
Presented by Adam Loutzenhiser
Microsoft Active Directory and Linux
Microsoft Active Directory is not a single service itself. Rather, it's composed of three separate services working in tandem to produce a centralized environment for authentication, authorization, and access.
In addition, we will also cover the basics Linux's standard authentication library, PAM.
Kerberos
Kerberos is an authentication service developed by MIT. It is defined in RFC1510.
Key Distribution Center
The KDC is composed of two services:
The Authentication Server distributes session keys and Tickets to authenticate a user to network services. When a user gets a session key from the AS, the AS encrypts the session key with the user's key.
Tickets are messages encrypted with the requested service's key.
The Ticket Granting Server is used to cache the key generated from a user's password.
Authentication Process
Ticket Granting Server
The Ticket Granting Server is a special network service used for caching the user's key.
Before using any other network service, the user authenticates to the TGS. The ticket used in this process is called the Ticket Granting Ticket (TGT). All further requests for Tickets are brokered through the TGS.
Without a TGS, the user would need to enter his password every time he wanted to access a network service. Because of the possibility of a third party recording the user's key, it is not safe to cache the user's key on the local system.
Relevant Commands and Files
Requests a TGT and caches it
Lists cached tickets
Removes tickets from the cache
Specifies the default KDC and authentication realm
Lightweight Directory Access Protocol
Lightweight Directory Access Protocol (LDAP) is used by various network systems to store data such as user privileges in a central repository.
LDAP is an internet standard defined in RFC2251.
Data Storage
LDAP is optimized for read operations and contains descriptive, attribute-based information.
An Object Class defines the attributes required for an entity, which may belong to one or more Object Classes. The Schema defines the Object Classes available to the LDAP tree.
The LDAP standard provides for four Object Classes:
Attributes
Attributes can be either Required Attributes or Allowed Attributes.
Attributes have a syntax definition to define the type of data an attribute may store:
Entities
Entities must be uniquely identified by one Distinguished Name (DN). The DN consists of the name of the entity and a path of names tracing the entry back to the top of the directory hierarchy.
Sample entity:
dn: cn=Luiz Malere, o=TUDelft, c=NL
cn: Luiz Malere
sn: Malere
mail: malere@yahoo.com
objectclass: person
Relevant Commands and Files
Searches for an entity in the LDAP tree by specifying a filter
Deletes entities in the LDAP tree
Modifies or adds entries to the LDAP tree
/etc/openldap/ldap.conf
Stores configuration for LDAP client utilities.
SMB and CIFS
SMB and CIFS are used primarily by Microsoft operating systems to share resources between computers.
SMB, sometimes knows as the LAN Manager protocol, stands for Server Message Block and is a protocol that dates back to DOS operating systems in the form of IBM's PC Network Program.
CIFS stands for Common Internet File System. It is the latest incarnation of SMB and represnts a collaborative effort among Microsoft and other vendors such as SCO.
Security Model
Historically, SMB's security was limited to applying a password to a network share, called share level security. Network shares could have two different passwords, one for read-only, and one for full access. Any user who supplied the correct password was granted access to the share in its entirety.
In Lan Manager 1.0, user level security allowed finer-grained access control. Users supply a username and password to authenitcate; in return they are granted a UID to use for all future requests.
LAN Browsing
Each computer must have a unique name, called the Netbios Name, as opposed to the computer's DNS name.
SMB and CIFS support a discovery process using Netbios broadcast packets to announce the presence of servers. One server is elected to become the Master Browser. The Master Browser maintains a list of all server in a given network.
Because broadcast packets do not route, Microsoft introduced Windows Internet Name Service (WINS) servers to collect lists of servers among subnets and share information over a WAN.
SMB and CIFS for Linux
SMB and CIFS have traditionally been the domain of Microsoft and their partners.
Through the efforts of the Samba project, Linux now has the ability to integrate with a SMB or CIFS based network to act as a file or print server.
Relevant Commands and Files
Browser for SMB and CIFS file shares
Mounts a SMB or CIFS share to the Linux filesystem
Queries the network for a Netbios Name
Responds to SMB and CIFS requests
Configures file and print shares
Pluggable Authentication Modules
We've seen so far how to query an LDAP tree for a list of users and how to get a TGT from a Kerberos KDC. This is not the way Windows does it. When you log in to Windows, Windows automatically gets a TGT for your session.
A project called Linux PAM, or Pluggable Authentication Modules, gives us the solution. Any login method that supports PAM is agnostic of how we obtain user authorization. This means that programs such as login, sudo, useradd, kdm, and gdm that were using PAM simply to check the Unix password files can use Kerberos/LDAP to authorize users by changing one service.
Management Groups
PAM offers services four different management groups:
The Module Stack
As PAM executes modules in each Management Group stack, there are different actions that PAM may take depending on a Control Flag:
Common Modules
PAM comes with several modules that are very common:
Relevant Commands and Files
This directory stores configuration files on a per-service basis. Examples: /etc/pam.d/login and /etc/pam.d/other
This the the default service; usually this should consist of only pam_deny.so and pam_warn.so
Normally run from agetty. Prompts the user for a username and password and executes their shell upon successful login
Additional Resources
Kerberos:
LDAP:
SMB and CIFS:
PAM: