Files
Cactidocumentation/Settings-Auth-LDAP.md
T
Thomas Vincent 741ad51355 docs: [1.2.x] refresh the front page, correct grammar and Markdown, and align plugin pages with their READMEs (#273)
* docs: [1.2.x] refresh the manual front page

The front page opened with version notes before saying what Cacti is,
used headings as sentences in the credits, and its table of contents
listed seven sections while the page has ten.

Open with a short description and a getting-started sequence, link the
website and forums, give the credits real headings, and list every
section in the table of contents in page order. Record Jeff Pasnak
under In Memoriam with a link to the 1.2.31 release announcement.
Correct label typos and wrap long entries with reference links.

Existing section anchors are unchanged, and every page is still linked.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] fix typos, unrendered headings and forum links

A check of every page linked from the front page found misspellings in
eleven pages, three Mactrack headings written without a space after the
hashes, which render as plain text, and two forum links still using
http.

Correct the spellings, add the missing space so the headings render,
and point the forum links at https, where they already redirect.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] align the plugin pages with the plugin READMEs

The supported plugins list and the Syslog and Mactrack pages had drifted
from the README and INFO files in the plugin repositories.

Update the descriptions that the READMEs contradict: Monitor's Thold
requirement, the Router Configs transfer methods, the ReportIt release
and Cacti versions, the WMI collection methods and its development
status, and NUT support in Apcupsd. Add the Syslog requirements, the
upgrade procedure, the dedicated database settings and the remote
collector settings, and correct the database grant and a misplaced
code fence. Add the Mactrack requirements and a short section on
history partitioning and ignored ports that links to the README.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] correct grammar, spelling and broken Markdown

A read of every page linked from the front page found grammar and
spelling errors throughout, and Markdown that does not render as
intended.

Correct grammar, spelling, punctuation and product-name capitalization
in 95 pages without changing headings, code blocks, link targets or
the meaning of the text. Repair the Markdown defects: a code fence in
the SSH tunnel how-to that never closed, malformed bold markers in the
user management and device defaults pages, a release notes table with
no blank line before it, split rows in the tree sorting table, and
LDAP list items missing their markers. Correct three interface labels
quoted with typos.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] correct statements that differ from the 1.2.x source

Reviewers of the linked pages flagged statements that looked wrong.
Each was compared with the Cacti 1.2.x source at 1523aa04b, and only
those the source or the page itself settles are changed.

Correct interface labels and option names (Index Count Changed,
Permissive, Not Selected, Utilities, the BCC description, the gear
icon for plugin install), the default Maximum Value of U for a new
data source item, the sysDescr object name, the PHP floor wording in
the requirements table, the Mactrack wildcard character and the
snmptrapd -On option. Repair cross-references, example values that
disagree with their commands, two table captions, a split list and
several sentences with missing words.

Statements the source does not settle are left as written.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-11-24 00:58:06 -08:00

17 KiB

LDAP Authentication

Cacti supports using LDAP authentication to access the Cacti GUI. There are several different ways to use LDAP, which will be described in the following sections.

Be Aware

New authentication settings may not take effect immediately. We recommend opening a new private browser window to test configuration changes.

Defining some terms

Before proceeding, please ensure you are familiar with the following terms:

  1. LDAP - A communication language, or protocol. It is a defined structure of how to ask questions of, and receive responses from, a directory. It also defines what questions there exist to be asked, and what responses there exist to be returned. LDAP is not a directory; it is a way to query a directory.

  2. Directory - A database of objects, accompanied with other attributes. Commonly, these objects are user identities, accompanied with passwords. Sometimes, the objects are groups, accompanied by a list of members. Usually the objects are stored in some type of hierarchical structure for organizational and management purposes.

  3. DN - Short for distinguished name, a string that represents a unique object in the directory. There cannot be two DNs alike in a directory. In Microsoft's Active Directory, this is a string like 'CN=Joseph,OU=Accounting,OU=Users,DC=corp,DC=example,DC=com'.

  4. Search - A type of LDAP request, in which the client sends some criteria to the server in an attempt to receive back a list of directory objects that meet the search criteria.

  5. Bind - A type of LDAP request, in which the client sends the server a username and a password in an attempt to confirm whether the password is correct for that user.

  6. sAMAccountName - An attribute found in Microsoft's Active Directory directory, and it is what we casually know as a username. The sAMAccountName does not uniquely represent an object in the Active Directory, whereas the DN does.

Configuring LDAP

LDAP General Settings

LDAP Settings Page

Mode

There are three basic routines that Cacti can execute when handling an LDAP authentication.

  1. No Searching - In this routine, Cacti simply binds to the LDAP server using the credentials that were entered during login. Cacti performs a transformation upon the username before binding, that which is specified in the Distinguished Name (DN) field. This transformation is useful, for example, to add a fully-qualified domain name suffix, or to add a NetBIOS domain name prefix. For example:

<username>@example.com

or

domain\<username>

  1. Anonymous Searching - In this routine, Cacti connects to LDAP with no authentication and attempts to perform a search for the username, in an attempt to retrieve the specific DN associated with the username. Once the specific DN of the username is found, Cacti binds to LDAP using the DN of the user and the password that was entered during login. Please note, by default, Microsoft's Active Directory does not permit anonymous searches, and will refuse the search request.

  2. Specific Searching - In this routine, Cacti binds to LDAP using a service account that was provided beforehand, then performs a search for the username, in an attempt to retrieve the specific DN associated with the username. Once the specific DN of the username is found, Cacti binds to LDAP using the DN of the user and the password that was entered during login.

Encryption

  1. None - This is plain-text, normally on port tcp/389. Passwords are transmitted over the network in clear text between Cacti and the directory.

  2. LDAPS - This is just like LDAP, but encrypted. This normally runs on port tcp/636. Please note, this is not enabled by default for Microsoft's Active Directory because it requires an encryption key and certificate to be installed on the AD controller(s).

  3. LDAP + TLS - This is plain LDAP, but a START_TLS command is sent by the client to the server to initiate encryption. Normally runs on port tcp/389 and can be entered into during a regular LDAP session.

Please note that some directories will limit the request types to which they respond when there is no encryption on the LDAP communication.

Referrals

An LDAP Referral is a field returned in an LDAP response message. The referral provides a list of alternate sources from which directory information can be obtained. In the case of a replicated directory such as Microsoft's Active Directory, the referral may contain an LDAP URL which could resolve to any participating LDAP server, whether correctly configured or not.

Other General Settings

The remaining LDAP General Settings are:

  • Server(s) - A space delimited list of DNS hostnames or IP addresses for valid LDAP servers. Cacti will attempt to use the LDAP servers from left to right to authenticate a user.

  • Port Standard - TCP port for Non-SSL communications including LDAP + TLS. The default is 389.

  • Port SSL - TCP port for LDAPS for SSL communications. The default is 636.

  • Protocol Version - Protocol Version to connect to the server with. The options are Version 2 and Version 3, and the default is Version 3.

  • Connect Timeout - The Network Connect Timeout in seconds. The default is 2.

  • Bind Timeout - The Bind Timeout in seconds. The default is 5.

  • LDAP Debug Mode - If checked, Cacti will log extra LDAP information to the Cacti log during Binding and Searching activities. It is disabled by default.

  • TLS Certificate Requirements - Should LDAP verify TLS Certificates when received by the Client. The options are Never, Hard, Demand, Allow and Try, and the default is Demand.

  • Require Group Membership - Require the user to be a member of a group to authenticate. Group settings must be set for this to work. Enabling it without proper group settings will cause authentication failure. It is disabled by default.

LDAP Group Settings

Cacti can enforce that a user be a member of a specific directory group to be granted access to Cacti. This is useful when your directory contains a mix of users who should and should not be granted access to Cacti. For Cacti to require that the user be a part of a group, Cacti will send a compare request to the directory server asking the server if a specific group has any parameters that contain a specific username. As an example, a compare request asks the following type of question:

Does there exist a group named CN=cacti-admins,OU=Admin_Groups,OU=Groups,DC=corp,DC=company,DC=com, attached to which there is an attribute named member, where the value of the attribute is CN=Joseph,OU=Admins,DC=example,DC=com?

The following three settings determine the content of the compare request.

  1. Group Distinguished Name (DN) - The DN of the group into which the directory server should search for attributes. For example:
CN=cacti-admins,OU=Admin_Groups,OU=Groups,DC=corp,DC=company,DC=com
  1. Group Member Attribute - The name of the attribute into which the directory server should search for the user. For example:
member
  1. Group Member Type - The format of the text string which should represent the user.

Specific Search Settings

  1. Search Base - The portion of the directory hierarchy inside which the server should perform the search. When the directory contains many objects, the time and resources required to search the directory are greater. The search base setting is useful to reduce the portion of the directory that is searched, thus increasing speed and reducing processor load on the directory server. This setting is also useful if you want to restrict access to Cacti to users who exist in a particular location in the directory hierarchy.

  2. Search Filter - The criteria for which the directory server should search. Any parameters that the server is capable of understanding are permitted here. Cacti will perform a substitution for the phrase <username> in the search filter, and will replace it with the username. This field must be in acceptable LDAP syntax. A useful example of a search filter would be:

(sAMAccountName=<username>)

But more complex filters are also permitted, such as:

(&(sAMAccountName=<username>)(memberOf=CN=cacti-admins,OU=Admin_Groups,OU=Groups
,DC=corp,DC=company,DC=com))
  1. Search Distinguished Name (DN) - The username of the service account with which Cacti will bind to the directory.

  2. Search Password - The password of the service account with which Cacti will bind to the directory.

LDAP CN Settings

Mapping an LDAP user to a Cacti user

Cacti stores many personal preferences and settings into its database that make it easier to use Cacti. For example, the GUI Theme, the Default View Mode, and the User Language are a few of these user settings. These settings are not stored in the LDAP directory, so they are not returned in the LDAP response. Therefore, Cacti will create a local user identity for each LDAP user who logs in. When Cacti creates a local user, it can automatically populate the following two parameters from the LDAP directory. If Cacti sees a local user already exists, it will not attempt to update the user with values from the directory.

  1. Full Name - The LDAP attribute name which contains a user's full name. Some common examples are 'displayname' or 'cn'.

  2. Email - The LDAP attribute name which contains a user's email address. One common example is 'mail'.

Always use lower case. No matter if the directory's attribute name contains uppercase characters (e.g. fullName), the respective field must be filled out in lower-case (fullname).

A few notes

One-Time Passwords (OTP / MFA)

Cacti supports directories where users authenticate with a One-Time Password (OTP) or another Multi-Factor Authentication (MFA) token, but the LDAP Mode must be chosen so that the user's single-use credential is presented to the directory only once.

On a single-server authentication path, Cacti binds the user's password exactly once, during the final authentication step. The Distinguished Name (DN) lookup that precedes it never uses the user's password (see the note on multi-server failover below):

  • No Searching performs no bind during the lookup (the DN is built from the template), then binds once as the user.
  • Anonymous Searching binds anonymously to locate the DN, then binds once as the user.
  • Specific Searching binds with the service account to locate the DN, then binds once as the user.

Group membership checks, when enabled, reuse the connection that was already bound with the user's credential and do not perform a second bind.

Because Active Directory refuses anonymous searches by default, an OTP/MFA deployment on AD should use Specific Searching with a dedicated service account. The service account performs the directory search so that the user's one-time code is preserved for the single authentication bind. No Searching is also safe for OTP when the DN template alone identifies the user, since it performs no directory lookup; choose Specific or Anonymous Searching only when a lookup is actually required to resolve the DN.

Finally, for OTP/MFA do not use the Server(s) space-delimited multi-server list. That field fails over from left to right, so if the first server consumes the one-time password and then returns an error, Cacti re-attempts the bind against the next server with an already-spent code, which will fail. Instead, point the Server(s) field at a single, resilient DNS name fronted by a DNS load balancer (VIP). Treat that DNS/load-balancer layer as the resilient, highly-available entry point: it handles backend failover transparently, so Cacti only ever performs one authentication bind per login and the single-use code is never replayed.

Certificate verification

When using LDAPS, a key and certificate must be installed on the directory server. When the client attaches to the server, it must make a decision to trust or reject the certificate that the server provided. The client will attempt to find the issuer of the certificate in a local repository of trusted certificate signers. If you install onto the directory server a certificate signed by an internal authority or a self-signed certificate, you will need to add the certificate of the issuer to the local repository on the Cacti server. If you do not, the client will surely reject the certificate, causing authentication to fail. To install a trusted certificate into the local repository, consult the documentation for the Operating System platform upon which you installed Cacti.

Search Result Reference (Referrals)

In Microsoft's Active Directory, LDAP response messages may contain a referral to other directory servers. If you are using LDAPS and have installed a certificate on some LDAP servers and not others, LDAP lookups will fail intermittently because LDAPS negotiations will succeed with some directory servers while failing with other directory servers. If you are experiencing intermittent LDAP failures, ensure that the Cacti server has network access to all directory servers, and that all directory servers are properly configured.

Common Scenarios

The following scenarios are designed to help you see the different ways to harness the power of LDAP and build a working LDAP configuration in your environment.

A small office where everyone has access to Cacti

In this scenario, a small LDAP directory contains users who are all granted access to Cacti (there are no users denied from Cacti). Some may be administrators, while others are read-only users.

To handle this scenario, start by creating a new local user in Cacti with read-only permissions. Name the user 'MyLdapTemplate'. Next, in Cacti's Authentication settings, set the User Template field to 'MyLdapTemplate'. Set the Mode to 'No Searching'. Set the Distinguished Name (DN) field to <username>@example.com, where 'example.com' is the name of your domain. When any user logs in to Cacti, their password will be checked against the LDAP directory and they'll be granted access to Cacti with read-only access (from the LDAP template user). Once a new user logs in, Cacti will create a local user where the user's Realm is 'LDAP'. You may then optionally promote that user to an administrator by visiting the Users page, locating the account for the LDAP user, and granting additional permissions to that user.

A large office where you only want a subset of users to access Cacti

In this scenario, a large LDAP directory contains a mix of users who should, and should not, be granted access to Cacti.

There are two ways to handle this scenario. You may either manually authorize users within Cacti, or you may use a group in the directory to define the authorized users.

To handle this scenario by manually authorizing users within Cacti, navigate to the Authentication settings, and set the User Template field to 'No User'. Set the Mode to 'No Searching'. Set the Distinguished Name (DN) field to <username>@example.com, where 'example.com' is the name of your domain. Next, navigate to the Users page and create a new user where the username matches the username in the directory. Set the user's Realm to 'LDAP'. Grant your desired permissions to the user. When that user logs in to Cacti, their password will be checked against the LDAP directory and they'll be granted access to Cacti based upon their local account.

To handle the large office scenario by using group membership, start by creating a user in the directory that can be used for searching the directory (this is sometimes referred to as a Service Account). Under normal circumstances, this directory user does not need elevated permissions. Next, create a group in the directory that contains all the users who should be granted access to Cacti. Next, in Cacti, create a new local user named 'MyLdapTemplate', with administrator permissions. In Cacti's Authentication settings, set the User Template field to 'MyLdapTemplate'. Set the Mode to 'Specific Searching'. Leave the Distinguished Name (DN) field blank. Set the Require Group Membership field to enabled. Set the Group Distinguished Name (DN) to the name of the group. Set Group Member Attribute to 'member'. Set Group Member Type to 'Distinguished Name'. Set Search Base to the DN of the hierarchical structure in the directory which contains all the users, such as 'OU=Users,DC=example,DC=com'. Set Search Filter to '(sAMAccountName=<username>)'. Set Search Distinguished Name (DN) to the username of the service account you created in the directory. Set Search Password to the password for the service account. Optionally, set Full Name to the directory attribute that contains the user's name, such as 'cn', and also set Email to the directory attribute that contains the user's email address, such as 'mail'.


Copyright (c) 2004-2026 The Cacti Group