All Products
Search
Document Center

E-MapReduce:Use LDAP authentication

Last Updated:Mar 26, 2026

LDAP authentication requires users to provide their LDAP credentials when connecting to Hive services, adding access control to your EMR cluster. EMR integrates with OpenLDAP out of the box, so you can enable authentication with a single switch — no manual LDAP configuration required for most setups.

If you are running an earlier EMR version or connecting to a self-managed LDAP server, follow the manual configuration path instead.

Prerequisites

Before you begin, ensure that you have:

  • A DataLake or custom cluster with both Hive and OpenLDAP services selected during creation. For more information, see Create a cluster

  • An EMR user added to OpenLDAP. For more information, see Add a user

Enable LDAP authentication with one click

This method uses the enableLDAP switch in the EMR console. The steps vary depending on your EMR version — both EMR V5.11.1 or later (EMR V3.45.1 or later) and earlier versions are supported. For connecting to a self-managed LDAP server, see Manually configure LDAP authentication.

Steps overview:

  1. Go to the Services tab for your cluster.

  2. Enable the enableLDAP switch for Hive.

  3. Restart HiveServer.

  4. Connect to HiveServer using your LDAP credentials.

Step 1: Go to the Services tab

  1. Log on to the EMR console.

  2. In the left-side navigation pane, click EMR on ECS.

  3. In the top navigation bar, select the region where your cluster resides and select a resource group.

  4. On the EMR on ECS page, find your cluster and click Services in the Actions column.

Step 2: Enable LDAP authentication

The steps vary depending on your EMR version.

For EMR V5.11.1 or later and EMR V3.45.1 or later:

  1. On the Services tab, click Status in the Hive section.

  2. In the Service Overview section, turn on the enableLDAP switch.

  3. In the dialog box, click OK.

For EMR V5.11.0 or earlier and EMR V3.45.0 or earlier:

  1. On the Services tab, click Status in the Hive section.

  2. In the Components section, find HiveServer. In the Actions column, select more > enableLDAP.

  3. In the dialog box, enter an execution reason in the Execution Reason field and click OK.

  4. In the Confirm dialog box, click OK.

Step 3: Restart HiveServer

  1. In the Components section, click Restart in the Actions column of HiveServer.

  2. In the dialog box, enter a reason in the Execution Reason field and click OK.

  3. In the Confirm dialog box, click OK.

Step 4: Connect to HiveServer

After HiveServer restarts, use your LDAP credentials to connect. SSH into your cluster (see Log on to a cluster), then run one of the following commands:

Beeline:

beeline -u jdbc:hive2://master-1-1:10000 -n <user> -p <password>

Java Database Connectivity (JDBC) connection string:

jdbc:hive2://master-1-1:10000/default;user=<user>;password=<password>

Replace <user> with the LDAP username and <password> with the LDAP password of the user you added in the prerequisite step.

Manually configure LDAP authentication

Use this path if you are on an earlier EMR version or connecting to a self-managed LDAP server instead of the built-in OpenLDAP service.

Before you start, collect the following information about your LDAP server:

InformationEMR built-in OpenLDAPSelf-managed LDAP
Hostnameemr-header-1Your LDAP server hostname or IP address
Port10389Your LDAP server port
Base DNou=people,o=emrThe base distinguished name (DN) for your users

Add configuration items to hiveserver2-site.xml

On the Configure page of the Hive service, go to the hiveserver2-site.xml tab and add the following configuration items. For more information, see Manage configuration items.

Configuration itemValueDescription
hive.server2.authenticationLDAPSets the authentication method for HiveServer2.
hive.server2.authentication.ldap.urlldap://{ldap_hostname}:{port} (e.g., ldap://master-1-1:10389)The URL of your LDAP server. Replace {ldap_hostname} with the hostname or IP address, and {port} with the port number.
hive.server2.authentication.ldap.baseDNou=people,o=emrThe base DN for user lookups. For the built-in OpenLDAP service, use ou=people,o=emr. For a self-managed LDAP server, set this to match your directory structure.

After saving the configuration, restart HiveServer2 for the changes to take effect.

Verify the connection

SSH into your cluster (see Log on to a cluster) and connect using LDAP credentials:

Beeline:

beeline -u jdbc:hive2://master-1-1:10000 -n <user> -p <password>

JDBC connection string:

jdbc:hive2://master-1-1:10000/default;user=<user>;password=<password>

A successful connection opens a Beeline prompt. If authentication fails, verify that the username and password match a valid entry in your LDAP directory.

Restrict access to specific users or groups

By default, any valid LDAP user can connect to HiveServer2. To limit access to specific users or groups, add the following configuration items to the hiveserver2-site.xml tab on the Configure page of the Hive service.

Configuration itemExample valueActionDescription
hive.server2.authentication.ldap.userDNPatternuid=%s,ou=people,o=emrAddThe DN pattern for user lookups. HiveServer2 replaces %s with the actual username during authentication.
hive.server2.authentication.ldap.groupFilterusernameAddA comma-separated list of LDAP groups. Only users in these groups can connect to HiveServer2.
hive.server2.authentication.ldap.groupClassKeyposixGroupAddThe objectClass value for LDAP group objects.
hive.server2.authentication.ldap.groupMembershipKeymemberUidAddThe LDAP attribute that stores group membership.
hive.server2.authentication.ldap.baseDNo=emrModifyUpdate the base DN to a path that covers both users and groups, so group filtering works correctly.

After saving the configuration, restart HiveServer2. Connect using a user that belongs to one of the groups specified in hive.server2.authentication.ldap.groupFilter.

Troubleshooting

Connection fails after enabling LDAP authentication for Hive

If you see the following error when running a Beeline command:

image

The user you specified in the connection command failed LDAP authentication. This usually means the user is not included in the hive.server2.authentication.ldap.groupFilter configuration.

To fix this, add the user to hive.server2.authentication.ldap.groupFilter in hiveserver2-site.xml, then restart HiveServer2. Alternatively, connect using a user that is already listed in groupFilter.