<?Pub UDT _bookmark _target?><chapter id="setupproblems-1"><?Pub Tag atict:info tracking="on" ref="0"?><title>LDAP Troubleshooting (Reference)</title><indexterm><primary>LDAP</primary><secondary>troubleshooting</secondary>
</indexterm><highlights><para>This chapter describes configuration problems and suggests solutions
for resolving them.</para><note><para>The LDAP service is managed by the Service Management Facility.
Administrative actions on this service, such as enabling, disabling, or restarting,
can be performed by using the <command>svcadm</command> command. See <olink targetptr="clientsetup-95" remap="internal">LDAP and the Service Management Facility</olink> for
more information about using the Facility with LDAP. For an overview of the
Facility, refer to <olink targetdoc="sysadv1" targetptr="hbrunlevels-25516" remap="external">Chapter 16, <citetitle remap="chapter">Managing Services (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.
Also refer to the <olink targetdoc="group-refman" targetptr="svcadm-1m" remap="external"><citerefentry><refentrytitle>svcadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="svcs-1" remap="external"><citerefentry><refentrytitle>svcs</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages for more details.</para>
</note>
</highlights><sect1 id="clientsetup-66"><title>Monitoring LDAP Client Status</title><para>The following sections show various commands to help determine the state
of the LDAP client environment. Also see the man pages for additional information
about the options that can be used.</para><para>For an overview of the Service Management Facility, refer to <olink targetdoc="sysadv1" targetptr="hbrunlevels-25516" remap="external">Chapter 16, <citetitle remap="chapter">Managing Services (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.
Also refer to the <olink targetdoc="group-refman" targetptr="svcadm-1m" remap="external"><citerefentry><refentrytitle>svcadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="svcs-1" remap="external"><citerefentry><refentrytitle>svcs</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages for more details.</para><sect2 id="clientsetup-67"><title>Verifying <literal>ldap_cachemgr</literal> Is
Running</title><para>The <literal>ldap_cachemgr</literal> daemon must be running and functioning
correctly at all times. Otherwise, the system doesn't work. When you start
the LDAP client, the client starts <literal>ldap_cachemgr</literal> daemon
automatically. So, if the <literal>ldap_cachemgr</literal> is not running,
the LDAP client will be disabled. Following are two methods for determining
if the LDAP client is online.</para><itemizedlist><listitem><para>Use the <command>svcs</command> command.</para><screen># <userinput>svcs \*ldap\*</userinput>
STATE          STIME    FMRI
disabled       Aug_24   svc:/network/ldap/client:default</screen><para>or</para><screen># <userinput>svcs</userinput> <option>l</option> <userinput>network/ldap/client:default</userinput>
fmri         svc:/network/ldap/client:default
enabled      true
state        online
next_state   none
restarter    svc:/system/svc/restarter:default
contract_id  1598 
dependency   require_all/none file://localhost/var/ldap/ldap_client_file (-)
dependency   require_all/none svc:/network/initial (online)
dependency   require_all/none svc:/system/filesystem/minimal (online)</screen>
</listitem><listitem><para>Pass the <option>g</option> option to <literal>ldap_cachemgr</literal>.</para><para>This option provides more extensive status information, which
is useful when you diagnose a problem.</para><screen># <userinput>/usr/lib/ldap/ldap_cachemgr</userinput> <option>g</option><userinput></userinput>
cachemgr configuration:
server debug level          0
server log file "/var/ldap/cachemgr.log"
number of calls to ldapcachemgr         19

cachemgr cache data statistics:
Configuration refresh information:
  Previous refresh time: 2001/11/16 18:33:28
  Next refresh time:     2001/11/16 18:43:28
Server information:
  Previous refresh time: 2001/11/16 18:33:28
  Next refresh time:     2001/11/16 18:36:08
  server: 192.168.0.0, status: UP
  server: 192.168.0.1, status: ERROR
    error message: Can't connect to the LDAP server
Cache data information:
  Maximum cache entries:          256
  Number of cache entries:          2</screen>
</listitem>
</itemizedlist><para>For more information about the <literal>ldap_cachemgr</literal> daemon,
see the <olink targetdoc="group-refman" targetptr="ldap-cachemgr-1m" remap="external"><citerefentry><refentrytitle>ldap_cachemgr</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="clientsetup-68"><title>Checking the Current Profile Information</title><para>Become superuser or assume an equivalent role, and run <command>ldapclient</command> with
the <option role="nodash">list</option> option.</para><screen># <userinput>ldapclient list</userinput>
NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_BINDDN= cn=proxyagent,ou=profile,dc=west,dc=example,dc=com
NS_LDAP_BINDPASSWD= {NS1}4a3788e8c053424f
NS_LDAP_SERVERS= 192.168.0.1, 192.168.0.10
NS_LDAP_SEARCH_BASEDN= dc=west,dc=example,dc=com
NS_LDAP_AUTH= simple
NS_LDAP_SEARCH_REF= TRUE
NS_LDAP_SEARCH_SCOPE= one
NS_LDAP_SEARCH_TIME= 30
NS_LDAP_SERVER_PREF= 192.168.0.1
NS_LDAP_PROFILE= pit1
NS_LDAP_CREDENTIAL_LEVEL= proxy
NS_LDAP_SERVICE_SEARCH_DESC= passwd:ou=people,?sub
NS_LDAP_SERVICE_SEARCH_DESC= group:ou=group,dc=west,dc=example,dc=com?one
NS_LDAP_BIND_TIME= 5</screen><para>Currently the <filename>/var/ldap</filename> files are in ASCII format.
Because the files could change to binary at some time, concatenating the files
would cause problems.  <command>ldapclient</command> <option role="nodash">list</option> is
the supported method for accessing this information. See the <olink targetdoc="group-refman" targetptr="ldapclient-1m" remap="external"><citerefentry><refentrytitle>ldapclient</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page
for more information.</para>
</sect2><sect2 id="clientsetup-70"><title>Verifying Basic Client-Server Communication</title><para>The best way to show that your client is talking to the LDAP server
is with the <command>ldaplist</command> command.  Using <command>ldaplist</command> with
no arguments dumps all the containers on the server.  This works as long as
the containers exist, and do not have to be populated. See the <olink targetdoc="group-refman" targetptr="ldaplist-1" remap="external"><citerefentry><refentrytitle>ldaplist</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page for
more information.</para><para>If the first step works, you can try <command>ldaplist passwd <replaceable>username</replaceable></command> or <command>ldaplist hosts <replaceable>hostname</replaceable></command> but if they contain lots of data you might want to
pick a less populated service, or pipe them to <literal>head</literal> or <literal>more</literal>.</para>
</sect2><sect2 id="clientsetup-69"><title>Checking Server Data From a Non-Client Machine</title><para>Most of the commands in the previous sections assume you already have
created an LDAP client.  If you have not created a client and want to check
the data on the server, use the <command>ldapsearch</command> command.  The
following example lists all of the containers.</para><screen># <userinput>ldapsearch</userinput> <option>h</option> <userinput>server1</userinput> <option>b</option> <userinput>"dc=west,dc=example,dc=com"</userinput> <option>s</option> <userinput>one "objectclass=*"</userinput></screen><para>In Solaris 9 and earlier releases, the <command>ldapsearch</command> command,
by default, produced output in a nonstandard textual representation. The default
output for <command>ldapsearch</command> in later Solaris releases is the
industry standardized LDIF format that is defined by RFC-2849. All versions
of <command>ldapsearch</command> can output LDIF format using the <option>L</option> option.</para>
</sect2>
</sect1><sect1 id="setupproblems-3"><title>LDAP Configuration Problems and Solutions</title><para>The following sections describe LDAP configuration problems and suggests
solutions to the problems.</para><sect2 id="setupproblems-13"><title>Unresolved Hostname</title><para><indexterm><primary>LDAP troubleshooting</primary><secondary>unresolved hostname</secondary></indexterm><indexterm><primary>LDAP troubleshooting</primary><secondary>unresolved hostname</secondary></indexterm>The Solaris platform
LDAP client back end returns fully qualified host names for host lookups,
such as host names returned by <function>gethostbyname</function> and <function>getaddrinfo</function>.  If the name stored is qualified, that is, contains at least
one dot, the client returns the name as is. For example, if the name stored
is <literal>hostB.eng</literal>, the returned name is <literal>hostB.eng</literal>.</para><para>If the name stored in the LDAP directory is not qualified (it does not
contain a dot), the client back end appends the domain part to the name. For
example, if the name stored is <literal>hostA</literal>, the returned name
is <literal>hostA.domainname</literal>.</para>
</sect2><sect2 id="setupproblems-7"><title>Unable to Reach Systems in the LDAP Domain
Remotely</title><para><indexterm><primary>LDAP troubleshooting</primary><secondary>unable to reach systems in LDAP domain remotely</secondary></indexterm><indexterm><primary>LDAP troubleshooting</primary><secondary>unable to reach systems in LDAP domain remotely</secondary></indexterm>If the DNS domain name is different
from the LDAP domain name, then the LDAP naming service cannot be used to
serve host names unless the host names are stored fully qualified.</para>
</sect2><sect2 id="setupproblems-9"><title>Login Does Not Work</title><para><indexterm><primary>LDAP troubleshooting</primary><secondary>login fails</secondary></indexterm>LDAP clients use the PAM modules for user authentication during
login. When using the standard UNIX PAM module, the password is read from
the server and checked on the client side. This can fail due to one of the
following reasons:</para><orderedlist><listitem><para><literal>ldap</literal> is not used by the <literal>passwd</literal> service
in the <filename>/etc/nsswitch.conf</filename> file.</para>
</listitem><listitem><para>The user's <literal>userPassword</literal> attribute on the
server list is not readable by the proxy agent. You need to allow at least
the proxy agent to read the password because the proxy agent returns it to
the client for comparison. <literal>pam_ldap</literal> does not require read
access to the password.</para>
</listitem><listitem><para>The proxy agent might not have the correct password.</para>
</listitem><listitem><para>The entry does not have the <literal>shadowAccount</literal> object
class.</para>
</listitem><listitem><para>No password is defined for the user.</para><para>When you
use <command>ldapaddent</command>, you must use the <option>p</option> option
to ensure that the password is added to the user entry. If you use <command>ldapaddent</command> without the <option>p</option> option, the user's password is not
stored in the directory unless you also add the <filename>/etc/shadow</filename> file
by using <command>ldapaddent</command>.</para>
</listitem><listitem><para>No LDAP servers are reachable.</para><para>Check the status
of the servers.</para><screen># <userinput>/usr/lib/ldap/ldap_cachemgr</userinput> <option>g</option><userinput></userinput></screen>
</listitem><listitem><para><literal>pam.conf</literal> is configured incorrectly.</para>
</listitem><listitem><para>The user is not defined in the LDAP namespace.</para>
</listitem><listitem><para><literal>NS_LDAP_CREDENTIAL_LEVEL</literal> is set to <literal>anonymous</literal> for <literal>pam_unix</literal>, and <literal>userPassword</literal> is
not available to anonymous users.</para>
</listitem><listitem><para>The password is not stored in <literal>crypt</literal> format.</para>
</listitem><listitem><para>If <literal>pam_ldap</literal> is configured to support account
management, login failure could be the result of one of the following:</para><itemizedlist><listitem><para>The user's password has expired.</para>
</listitem><listitem><para>The user's account is locked out due to too many failed login
attempts.</para>
</listitem><listitem><para>The user's account has been deactivated by the administrator.</para>
</listitem><listitem><para>The user tried to log in using a nonpassword-based program,
such as <command>rsh</command>, <command>rlogin</command>, <command>ssh</command>,
or <command>sftp</command>.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para>If per-user authentication and sasl/GSSAPI are being used,
then some component of Kerberos or the <literal>pam_krb5</literal> configuration
is setup incorrectly.  Refer to the <olink targetdoc="sysadv6" remap="external"><citetitle remap="book">System Administration Guide: Security Services</citetitle></olink> for
details on resolving these issues.</para>
</listitem>
</orderedlist>
</sect2><sect2 id="setupproblems-10"><title>Lookup Too Slow</title><para><indexterm><primary>LDAP troubleshooting </primary><secondary>lookup too slow</secondary></indexterm>The LDAP database relies on indexes to improve
search performance. A major performance degradation occurs when indexes are
improperly configured. The documentation includes a common set of attributes
that should be indexed. You can also add your own indexes to improve performance
at your site.</para>
</sect2><sect2 id="setupproblems-11"><title><command>ldapclient</command> Cannot Bind
to Server</title><para><indexterm><primary>LDAP troubleshooting</primary><secondary>ldapclient cannot bind to server</secondary></indexterm><command>ldapclient</command> failed
to initialize the client when using the <option role="nodash">init</option> option
with the <literal>profileName</literal> attribute specified. Possible reasons
for failure include the following:</para><orderedlist><listitem><para>The incorrect domain name was specified on the command line.</para>
</listitem><listitem><para>The <literal>nisDomain</literal> attribute is not set in the
DIT to represent the entry point for the specified client domain.</para>
</listitem><listitem><para>Access control information is not set up properly on the server,
thus disallowing anonymous search in the LDAP database.</para>
</listitem><listitem><para>An incorrect server address passed to the <command>ldapclient</command> command.
Use <command>ldapsearch</command>  to verify the server address.</para>
</listitem><listitem><para>An incorrect profile name passed to the <command>ldapclient</command> command.
Use <command>ldapsearch</command>  to verify the profile name in the DIT.</para>
</listitem><listitem><para>Use <command>snoop</command> on the client's network interface
to see what sort of traffic is going out, and determine to which server it
is talking.</para>
</listitem>
</orderedlist>
</sect2><sect2 id="setupproblems-2224"><title>Using <command>ldap_cachemgr</command> for
Debugging</title><para>Using <literal>ldap_cachemgr</literal> with the <option>g</option> option
can be a useful way to debug, as you can view the current client configuration
and statistics. For example,</para><screen># <userinput>ldap_cachemgr</userinput> <option>g</option><userinput></userinput></screen><para>would print current configuration and statistics to standard output,
including the status of all LDAP servers, as mentioned previously. Note that
you do <emphasis>not</emphasis> need to become super user to execute this
command.</para>
</sect2><sect2 id="setupproblems-2225"><title><command>ldapclient</command> Hangs
During Setup</title><para>If the <command>ldapclient</command> command hangs, pressing Ctrl-C
will exit after restoring the previous environment.  If this happens, check
with the server administrator to ensure that the server is running.</para><para>Also check the server list attributes in either the profile or from
the command line and make sure that the server information is correct.</para>
</sect2>
</sect1>
</chapter><?Pub *0000016950 0?>