====
Distro: Fedora 8
Server: Fedora Directory Server 1.1
I. First off, some really basic intro:
LDAP (Lightweight Directory Access Protocol) is client-server protocol for accessing directory service. A directory server provides a centralized directory service for your network that can integrate wide variety of information.
Fedora Directory Server is a secure, highly scalable, robust LDAP server implementation of Red Hat and was derived from the original slapd directory server work done by UM.
II. Installation and General Fedora Directory Server Usage
- Clean installation of Fedora 8.
Note: most packages required for installing Fedora Directory Server are hosted in Fedora Repository and would require Internet access on the server. - Install a Java JRE, on Fedora 8 you can use IcedTea Java
yum -y install java-1.7.0-icedtea - Setup Fedora DS yum repo,
cd /etc/yum.repos.d/
wwget http://directory.fedoraproject.org/sources/idmcommon.repo
wget http://directory.fedoraproject.org/sources/dirsrv.repo - Install Fedora Directory,
yum -y install fedora-ds - Initial setup to create an instance of the directory server
cd /usr/sbin/
./setup-ds-admin.pl
Note: Choose "Typical Installation". Also, most installation setup options
are reasonably set, so you can accept default options. - Install the remote management console for managing Fedora Administration
Server.
yum -y install fedora-idm-console - Install the command line tools for accessing Fedora Directory Server
yum -y install mozldap-tools
Note: The openldap-clients package provide similar tool functionality for
accessing traditional OpenLDAP servers. - Starting the Fedora Directory Server and Administration Server
service dirsrv start
service dirsrv-admin start
Note: When starting the dirsrv the first time, specify the directory
instance. To automatically start the directory services, run the following
command:
chkconfig dirsrv on
chkconfig dirsrv-admin on
Files for Fedora Directory Server can be found at,
Log Files: /var/log/dirsrv
Config Files: /etc/dirsrv/
Database: /var/lib/dirsrv/slapd-instance
Client Tools: /lib/usr/mozldap
- The directory information tree (DIT) mirror the tree model used by most
filesystem, with the tree's root appearing on top of the hierarchy. - The entry is an object that represent a particular information in directory tree (ie. person in your organization, printer in network). It is stored in a hierarchical structrue in the directory tree. An entry is defined in LDIF file.
- LDIF file is standard text-based format. Each entry in LDIF file is represented by attributes and their values.
- Schema defines the attributes type that each entries can contain. Standard schema can be found in /etc/dirsrv/schema directory.
- Starting the Fedora Server Console
fedora-idm-console -a http://localhost:9830 - Create Organizational Unit under root directory
1. Servers and Applications ->Directory Server-> Directory
2. Choose the root suffix and right click.
3. Choose New->Organizational Unit - Adding 'Users' in Organizational Unit
1. Servers and Application->Directory Server-> Directory
2. Right click the appropriate Organizational Unit
3. Choose New->User - Importing data from the Directory Server Console
1. Servers and Applications ->Directory Server->Open->Task
2. In the Import Database dialog box, enter full path
3. Go to Directory tab to verify if data was successfully imported. - Modifying entries in the Directory
1. Servers and Applications->Directory Server->Open->Directory
2. Right click on the entry you wish to modify
3. Choose Advanced Properties
4. Choose Attribute you wish to modify - Deleting entries in the Directory
1. Servers and Applications->Directory Server->Open->Directory
2. Right click on the entry you wish to delete
3. Choose delete option
- Create Organizational Unit under root directory
ldapmodify -v -a -D "cn=directory manager" -h <hostname> -p <port> -f
<file.ldif> -w - - Create user account under Organization Unit
ldapmodify -v -a -D "cn=directory manager" -h <hostname> -p <port> -f
<users.ldif> - To delete Directory entries
ldapdelete -D "cn=directory manager" -h <hostname> -p <port>
"uid=u1research,ou=research,dc=example,dc=com" -w -
Note: You can only delete entries at the end of branch. You cannot delete
entried that have sub-entries. - Modify Directory entries
ldapmodify -v -D "cn=directory manager" -h <hostname> -p <port> -f
<file.ldif> -w -
- Groups are mechanism for associating entries into a list.
- Roles is another entry grouping mechanism, it enables you to determined role
membership as soon as an entry is retrieved from the directory. - Creating Groups:
1. Servers and Applications ->Directory Server->Open->Directory.
2. In Menu, Object->New->Group
3. Add group name in General folder and members in Member folder.
To list down members for certain group,
ldapsearch -v -D "cn=directory manager" -h <host> -p <port> -b
"dc=example,dc=com" "cn=<name>" -w - - Creating Roles:
1. Servers and Applications ->Directory Server->Open->Directory.
2. In Menu, Object->New->Roles
3. Add group name in General folder and members in Member folder.
To list specific Roles for user,
ldapsearch -v -D "cn=directory manager" -h <host> -p <port> -b
"dc=example,dc=com" "uid=<userid>" \* nsRole -w -
To find all members of a particula role,
ldapsearch -v -D "cn=directory manager" -h <host> -p <port> -s sub -b
"dc=example,dc=com" "(nsRole=cn=,dc=<name>,dc=lt;name>)" dn -w -
Roles mechanism is generally more efficient to use for applications as it reduce client complexity but it is more resource-intensive on the server side.
VII. Access Control
Fedora Directory Access Control defines the mechanism on how a user can access
Directory information. Access Control Instructions (ACI) are defined as attributes of entries. The three main parts of ACI are:
- Target, specify the entry, attributes for which you want to control access.
- Permission, specify the type of access that is allowed or denied.
- Bind Rule, identify the set of users to which ACI applies.
1. Servers and Applications ->Directory Server->Open->Directory.
2. Choose the object you wish to create an ACI
3. Right click and choose Set Access Permission
4. In the Access Control Editor, set the name for ACI entry
5. In the 'Users' tab, add members (could be individual/group/roles)
VIII. Centralized Linux Authentication
- A more robust and secure alternative to using centralized authentication system through NIS.
- User accounts information are stored in Directory server for retrieval during authentication from client side.
- Home directories of the user resides in the Directory server and exported to the client side.
- To setup Fedora Directory as authentication server for client.
- Create the Linux user account in the server. Take note of uid and gid and /home directory for the account.
- In the Directory, go to "Users and Group" tab.
- Click on Create->User
- Select the Organizational Unit to put the user in and create the user account.
- In the "Posix User", fill in the account info based with UID, GID, Home Directory.
- Export(NFS) the home directory.
- In client side, configure authentication to use the Directory server.
- In the client side, edit /etc/auto.master file and add the following:
/home /etc/auto.guests --timeout=60 - In the client side, edit /etc/auto.guests file and add the following:
* -rw,soft,intr:/home/& - Set autofs to automount home directories from the server
chkconfig autofs on
chkconfig nfs on
service autofs start
service nfs start
Additional Notes:
Tools under openldap-clients are not supported for Directory Server
operations. For best results with Directory Server, use tools in
mozldap-tools. Tools in this package are found in /usr/lib/mozldap
directory.
Alternatively, you can use Kontact, a GUI tool for accessing LDAP server.
Kontact is included in the kdepim rpm package.
Directory Server Gateway/Phonebook is simple web-based application that
provides search/query/update interface for directory server data but is
currently not available for version 1.1 Fedora DS.
