All the information you can store in a Network Information Service (NIS) can also be stored in an LDAP server. This article describes how to use the 389 Directory Server to function as a Network Information Service by showing how to store the list of service as an example.

Creating an LDAP entry

Create Organizational Unit1. Create a new organizational unit called Services that will hold all your services.
Create Object2. Select the Services organizational unit. Right click an empty space in the right pane, select New then click Other.
New Object3. In the New Object window, select ipservice and click OK.
Property Editor4. Fill in the Full name, ipserviceport and ipserviceprotocol and click the Change button.
Change Naming Attribute5. In the Change Naming Attribute window, check cn and uncheck ipserviceprotocol. Click the OK button to close the Change Naming window and click OK again to close the Property Editor window.
Directory Services6. You should now have a service entry.

Configuring the Client

Edit ldap.conf1. Edit the file /etc/ldap.conf and update at least the items below with the appropriate values for your environment.
host ldap.acme.local
base dc=acme,dc=local
nss_base_services ou=Services,dc=acme,dc=local?one
Edit nsswitch.conf2. Edit the file /etc/nsswitch.conf and add ldap in the services entry. This will tell the system to also look in the LDAP server when enumerating the list of service.
Edit nsswitch.conf3. To test, type in the command below. You should be able to see the entry you added.
getent services

Visit the forum to ask for help or to give a comment.

***
Posted on 11/24/2009 and last updated on 11/24/2009
Filed under 389 Directory Server , LDAP