Home > Articles > Operating Systems, Server > Solaris

  • Print
  • + Share This
Like this article? We recommend

Solaris 9 OE Secured LDAP Client and Server Configuration

The procedure for installing and configuring the directory server and client initialization has changed significantly in the Solaris 9 OE Secured LDAP Client implementation. The following sections explain the changes.

Directory Server Configuration

The most obvious change in the Solaris 9 OE is that the Sun ONE Directory Server 5.1 is the supported directory server in place of the Netscape Directory Server 4.1x.

In addition, the directory server software is packaged differently. Instead of being contained in a single compressed tar file, it is divided into several Solaris OE packages.

NOTE

The package format is only available with the Solaris 9 OE. For other versions of the Solaris OE, download the compressed tar file version.

The following 13 packages comprise the directory server software:

  • IPLTadcon: Administration Server Console

  • IPLTadman: Administration Server Documentation

  • IPLTadmin: Administration Server

  • IPLTcons: Console Client Base

  • IPLTdscon: Directory Server Console

  • IPLTdsman: Directory Server Documentation

  • IPLTdsr: Directory Server (root)

  • IPLTdsu: Directory Server (usr)

  • IPLTjss: Network Security Services for Java_

  • IPLTnls: Nationalization Languages and Localization Support

  • IPLTnspr: Portable Runtime Interface

  • IPLTnss: Network Security Services

  • IPLTpldap: PerLDAP

To Install the Solaris OE Packages

The Solaris OE packages are installed with the full distribution, or can be installed after the Solaris 9 OE is installed. If you install them later, you must install them in the correct sequence.

  • When you install the Solaris OE packages, install them in the correct sequence, as follows:

    PKGDIR=/cdrom/sol_9_sparc_2/Solaris_9/Product
    pkgadd -d $PKGDIR IPLTdsman
    pkgadd -d $PKGDIR IPLTadman
    pkgadd -d $PKGDIR IPLTnspr
    pkgadd -d $PKGDIR IPLTnls
    pkgadd -d $PKGDIR IPLTnss
    pkgadd -d $PKGDIR IPLTjss
    pkgadd -d $PKGDIR IPLTpldap
    pkgadd -d $PKGDIR IPLTcons
    pkgadd -d $PKGDIR IPLTdscon
    pkgadd -d $PKGDIR IPLTadcon
    pkgadd -d $PKGDIR IPLTdsr
    pkgadd -d $PKGDIR IPLTdsu
    pkgadd -d $PKGDIR IPLTadmin

To Install the Directory Server

A wrapper program called /usr/sbin/directoryserver is included in the Solaris 9 OE version of the directory server. The purpose of the wrapper is to simplify operations by removing path name dependencies. For example, the generic directory server installation allows you to specify the target directory and the instance name of the directory server you are installing. Therefore, you need to remember the path name where the directory server files were installed. The wrapper program figures out the correct path for you.

  • To install the directory server, run setup from the wrapper, as follows:

    # /usr/sbin/directoryserver setup

    The dialogue that appears after you run setup is similar to what appears during a generic directory server installation. What is different is that you are not prompted to accept the server license, and the target directory and the directory server instance name are chosen for you. The target directory is /usr/iplanet/ds5 and the instance name is slapd-hostname. While the files in these directories might look familiar to you, they should never be addressed directly. Instead, always use the wrapper program to perform operations on them.

    NOTE

    Never run the uninstall program directly. Use the directoryserver wrapper, instead. Failure to do so results in the deletion of critical files, which will prevent you from running setup again.

Netscape Directory Server 4.16.1 and Sun ONE Directory Server 5.1 Differences

The directory server supported with the Solaris 9 OE has many advantages over the previous version. However, different configuration procedures are required to set up the Solaris OE LDAP Client on the newer directory server because of these new features. This means that the setup_native_LDAP.sh script used to configure the Solaris 8 OE (see "Setting Up the Solaris 8 OE LDAP Client and Server Configuration" on page 8) will not work. The new features that affect configuration include:

Schema file storage—In the previous version, schema files were stored as *.conf files in an user-friendly format. The schema was separated into two files, one for object classes and one for attributes. New object classes and their attributes were placed in files called slapd.user_oc.conf and slapd.user_at.conf.

The new directory server stores schema files in LDAP Data Interchange Format (LDIF), which can contain object class and attribute definitions, in addition to the slapd.user_oc.conf and slapd.user_at.conf files. New definitions are added by creating a text file with an .ldif extension and placing it in the schema directory located under the server instance you are working with. By convention, the new schema definitions are placed in a file called 99user.ldif. The files are processed in numeric order similar to the way Solaris OE rc scripts are processed.

Multiple database support—The previous version maintained all directory data in a single database, restricting the data to a single volume and allowing only one set of indexes for the whole directory. The new version allows multiple database backends that can reside on different volumes and have their own indexes. This means that some directory entities are referenced slightly different than in the previous version.

New authentication methods—The new directory server supports SASL/DIGEST-MD5 authentication that provides a method of encrypting a password before it is sent to the server. This feature first appeared in iPlanet Directory Server 5.0.

New LDAP Client Profile Format

To support the numerous Solaris 9 OE Secured LDAP Client enhancements, a new profile object class called DUAconfigProfile is defined. The following features are supported through attributes set in the new profile:

Service Search Descriptors—Allows you to specify a search path for naming service databases and filter the requests. For example, you can specify additional locations to search for database entries if an entry is not found in the first location. You can also assign an employee type such as permanent or temporary to account entries, then set up a filter to let only permanent employees log into a particular computer.

Attribute/Objectclass Mapping—Allows you to use a non-default object class or attribute. For example, defining user accounts somewhere other than the posixAccount object class.

Authentication Service Methods—Allows you to assign a different authentication method to a different service. For example, pam_ldap might use simple authentication with SSL/TLS, while the passwd command might use SASL/DIGEST-MD5.

The Solaris 9 OE Secured LDAP Client was designed to be backward-compatible with a server configured to support Solaris 8 OE LDAP Clients. The behavior of the client depends, in part, on the profile used initialized it.

NOTE

The Solaris 9 OE implementation requires the use of profiles and the LDAP cache manager.

The old profile type is identified as:

NS_LDAP_FILE_VERSION = 1.0

The new profile type is:

NS_LDAP_FILE_VERSION = 2.0

The profile type is determined by whether the profile contains the DUAconfigProfile object class or the SolarisNamingProfile object class. Profiles containing the former class are considered version 2.0.

New Automount Object Class

In the Solaris 8 OE implementation, automount maps were represented by the generic nisObject object class, which contained a key and an associated value. The Solaris 9 OE implementation introduces two new object classes to hold automap information: automount and automountMap.

You must take this difference into consideration when supporting both Solaris 8 OE and Solaris 9 OE LDAP clients on the same directory server.

New Security Features and Enhancements

The SSL/TLS libraries that are integrated with the Secured LDAP Client are an important addition to the Solaris 9 OE. This enhancement enables the client to run LDAP over the SSL/TLS transport, the benefit of which is that LDAP traffic can be encrypted to prevent eavesdropping.

Support of the SASL/DIGEST-MD5 authentication method is another security enhancement in the Solaris 9 OE. This method allows the encryption of just the password using a message digest. The details on how this actually works are very complex, but the configuration is not complicated.

The requirement that proxyagent credentials be stored in the client profile has been removed in the Solaris 9 OE. Instead of storing them in the profile, which is susceptible to snooping while the LDAP client cache is refreshed, they are maintained only in the local /var/ldap/ldap_client_cred file. This implies that Solaris 9 OE clients need to be supplied with the proxyagent credentials manually.

Command Differences

In the Solaris 9 OE, one new command has been added, one command has been dropped, and the syntax of another has changed. These changes are as follows:

ldapaddent—This new command can be used to populate the directory from text files in the files format. This command can only be run on a configured Solaris 9 OE Secured LDAP Client because the command determines what directory server to use and where to place the data in the DIT from the client profile.

If the client is configured to use a version 1 profile, automaps are mapped to the old style nisObject object class. If a version 2 profile is being used, they are mapped to the new automount and automountMap object classes.

ldap_gen_profile—This command has been replaced with the genprofile switch in the updated ldapclient command.

ldapclient—The syntax for this command has changed significantly. The switches such as -l and -i have been replaced with keywords like list and init. The new syntax appears as follows:

ldapclient [-v | -q] 
genprofile | init | manual | mod | list | uninit [args]

where args takes the form of -a attrName=attrVal. For example, to specify a profile, you would use -a profileName=myprofile.

To Configure the Sun ONE Directory Server 5.1 and the Solaris OE Secured Client

After installing and configuring the server with the directoryserver setup command, configure the server to support Secured LDAP Clients.

  1. Run the /usr/lib/ldap/idsconfig script.

    The script asks a number of questions, most of which have to do with setting up the parameters in the client profile.

    NOTE

    After the idsconfig script completes, you are instructed to run the directoryserver vlvindex command to create the VLV indexes. If you run the command before populating the directory server with data, error messages will be displayed. These messages are harmless and you can ignore them.

  2. Initialize the client by running the following command:

    ldapclient init -a profilename=myprofile 192.9.200.1 -a proxyDn -a proxypassword
  3. If you are using pam_ldap, edit the /etc/pam.conf file.

To Set Up SSL/TLS

To use SSL/TLS, both the server and clients need to be configured. The server must be set up to use port 636 for the encrypted channel, and port 389 for the clear-text channel. Before setting up the server you need to have the following items:

A signed server certificate

The signer's certificate

Obtain a service certificate from a certificate authenticor (CA) you set up or from a commercial one (**ID). Alternatively, use the certutil utility to create self-signed certificates. This certificate gets installed on the directory server. Once installed, SSL can be enabled.

NOTE

The server certificate is kept in a database that is password protected. You are prompted for this password each time the directory server starts, unless you place it in a special configuration file that is described in the Sun ONE Directory Server 5.1 documentation.

The client must have a certificate database that contains the signer's certificate. This database can be created by a Netscape browser, then moved to the appropriate place. See the Sun document, System Administration Guide: Naming and Directory Services manual, (part number 806-4077-10) for additional information.

To Set Up the Sun ONE Directory Server 5.1 on the Solaris 8 OE

At the time this article was written, a Sun Microsystems, Inc. supported script that configured the Sun ONE Directory Server 5.1 running on the Solaris 8 OE was not available. The Solaris 9 OE idsconfig script will not work because of dependencies on the new and modified commands discussed earlier.

Most of the steps are the same as those used to configure the Netscape Directory Server 4.1x as described in the Sun BluePrints book, Solaris and LDAP Naming Services, with the following differences:

  1. Update the schema files.

    Obtain the 99user.ldif file from from a Solaris 9 OE directory server installation that is configured with the idsconfig command.

    NOTE

    If you are using the Sun ONE Directory Server 5.1, service pack 1, remove the reference to automount and automoutMap in the 10rfc2307.ldif file.

  2. Create VLV indexes.

    1. Import the following LDIF replacing sun.com with your domain name. For example, to create the VLV index for the passwd database:

      dn: cn=sun.com_passwd_vlv_index, cn=user  
      Root, cn=ldbm database,cn=plugins, cn=config
      objectClass: top
      objectClass: vlvSearch
      cn: sun.com_passwd_vlv_index
      vlvBase: ou=people,dc=sun,dc=com
      vlvScope: 1
      vlvFilter: (objectClass=posixAccount)
      aci:(target="ldap:///cn= sun.com_passwd _vlv _ index, 
      cn=userRoot, cn=ldbm database, cn=plu gins,cn=config")
      (targetattr="*")(version 3.0; acl "Config";
      allow(read,search,compare) userdn= "ldap:///anyone";)
      
      dn: cn=sun.com.getpwent,cn=sun.com_ passwd _vlv_index,
      cn=userRoot,cn=ldbm database, cn= plugins,cn=config
      cn: sun.com.getpwent
      vlvSort: cn uid
      objectClass: top
      objectClass: vlvIndex
      vlvEnabled: 1
      vlvUses: 1
    2. Repeat the preceding step, substituting the following attributes and object classes:

      shadow- getspent, objectclass=ShadowAccount
      group- getgrent,objectclass=PosixGroup
      hosts - gethostent, objectclass=ipHost
      networks - getnetent, objectclass=ipNetwork
      rpc - getrpcent, objectclass=oncRpc
    3. Run the following command from the server-root server-instance directory:

      vlvindex -n userRoot -T sun.com.getpwent
      vlvindex -n userRoot -T sun.com.getspent
      vlvindex -n userRoot -T sun.com.getgrent
      vlvindex -n userRoot -T sun.com.gethostent
      vlvindex -n userRoot -T sun.com.getnetent
      vlvindex -n userRoot -T sun.com.getrpcent
  3. Create indexes.

    Indexes are maintained for each database backend, so the dn: of the index needs to reflect this. For example:

    dn: cn=uid,cn=index,cn=userRoot,cn=ldbm data ba se,
    cn=plugins,cn=config
    objectClass=top
    objectClass=nsIndex
    cn=uid
    nsSystemIndex=false
    nsIndexType=eq
  4. Create your client profiles with the ldap_gen_profile command.

Debugging Common Problems

After your directory server has been configured for LDAP Clients and populated with data, users should be able to log in. If any problems develop, it is helpful to understand the steps that are being performed when logging into a Solaris 8 or 9 OE system that is set up to use LDAP.

The snoop command can be a valuable tool in understanding these steps. The following example assumes that pam_unix and pam_ldap are stacked so that pam_unix is tried first. The credential level is proxy, and to support pam_unix logins with LDAP accounts, the proxyagent is granted password read permission.

To help illustrate the login process, encryption is not turned on. In a production environment, this would not be the case, so you would not be able to observe passwords in the clear.

To Debug Common Problems

The first thing you should do if you encounter problems is to make sure the account is configured the way you think it should be.

  1. To check the configuration of an account, run the ldaplist command on the client:

    # ldaplist -l passwd tom
    dn: uid=tom,ou=people,dc=sun,dc=com
    objectClass: posixAccount
    objectClass: shadowAccount
    objectClass: account
    objectClass: top
    uid: tom
    cn: Tom Bialaski
    uidNumber: 12345
    gidNumber: 10
    gecos: Tom Bialaski - Enterprise Engineer
    homeDirectory: /home/tom
    loginShell: /bin/csh
    userPassword:{SSHA}irwM5kVMuJgpYEd+S
    shadowLastChange: 11892
    shadowFlag: 0
    From this listing, you can tell that the user tom 
    does not have a password stored in {crypt} format, so  
    pam_ldap authentication is used.
    Next, turn on snoop on your directory server or client:
    # snoop -v ldap | grep LDAP

    From this listing, you can tell that the user tom does not have a password stored in {crypt} format, so pam_ldap authentication is used.

  2. Next, turn on snoop on your directory server or client, as follows:

    # snoop -v ldap | grep LDAP

The following example of a condensed snoop trace shows what takes place when user tom logs in. The bolded commands show what the example user types.

  1. The user binds to the directory as the proxyagent, as follows:

    Operation *[APPL 0: Bind Request]
    [Object Name]
      cn=proxyagent,ou=profile,dc=sun,dc=com
     Authentication: Simple [0]
      test1234
    Operation *[APPL 1: Bind Response]
    [Result Code]
      Success

    Because, for this example, encryption is turned off, you can see the actual domain name and associated password the client is attempting to bind with. In this example, the bind operation is successful.

  2. The user searches the directory to see if user tom exists, as follows:

    Operation *[APPL 3: Search Request]
    [Base Object]
      ou=people,dc=sun.com
    Equality Match *[3]
    [Attr Descr]
      objectClass
    [Value]
      shadowAccount
      *[3]
     [OctetString]
      uid
     [OctetString]
      tom

    If an entry with the shadowAccount object class and uid=tom is found, the operation is successful.

  3. The user attempts to retrieve the user's password (remember that pam_unix is the first one in the stack), as follows:

    Operation *[APPL 4: Search ResEntry]
    [Object Name]
      uid=tom,ou=people,dc=sun,dc=com
    *[Attribute]
      uid
     [Value]
      tom
     *[Attribute]
      userpassword
    [Value]:             
      {SSHA}irwM5kVMuJgpYEd+S
     *[Attribute]
      shadowlastchange
     [Value]
      11892

    Because pam_unix expects to see the password returned in {crypt} format, the authentication fails and the next PAM in the stack is tried.

  4. The user attempts to authenticate the password with pam_ldap, as follows.

    Operation *[APPL 0: Bind Request]
     [Object Name]
      uid=tom,ou=people,dc=sun,dc=com
    Authentication: Simple [0]
     Mysecret

    If the bind succeeds, the user is authenticated.

  5. The user retrieves user information, as follows:

    Operation *[APPL 4: Search ResEntry]
    [Object Name]
      uid=tom,ou=people,dc=sun,dc=com
    *[Partial Attributes]
    *[Attribute]
    cn
    [Value]
        Tom Bialaski
     uid
     [Value]
        tom
     *[Attribute]
     uidnumber
     [Value]
      12345
    *[Attribute]
    gidnumber
    [Value]
      10
    *[Attribute]
    gecos
     [Value]
      Tom Bialaski - Enterprise Engineer
     *[Attribute]
    homedirectory
     [Value]
      /home/tom
    *[Attribute]
     loginshell
      /bin/csh

    The login information can now be used to set the home directory, execute a login shell, and set the user's user identifier (UID) and group identifier (GID).

  6. The user locates the user's home directory, as follows:

    Operation *[APPL 4: Search ResEntry]
     [Object Name]
    automountKey=tom,automountMapName= au to_home,dc=sun,dc=com
    objectClass
     [Value]
    automount
    [Value]
    top
    *[Attribute]
    automountKey
     [Value]
      tom
    *[Attribute]
    automountInformation
     [Value]
      nfsserver7:/export/home7/tom

    The user is now logged in.

    NOTE

    The .login, .cshrc, and .profile files are examined and additional naming server lookups are performed. For brevity, these operations are not shown.

    The Solaris 9 OE delivered the second phase of the LDAP Client that includes several security enhancements and is better integrated than the previous release. The Solaris 9 OE implementation is compatible with the Solaris 8 OE implementation so a single server can be configured to support both.

  • + Share This
  • 🔖 Save To Your Account