---
title: Native and Pluggable Authentication Modules (PAM) authentication
description: API Security Enforcer (ASE) provides two types of authentication:
component: pingintelligence
version: 5.2
page_id: pingintelligence:pingintelligence_reference_guide:pingintelligence_configure_native_pam_authentication
canonical_url: https://docs.pingidentity.com/pingintelligence/5.2/pingintelligence_reference_guide/pingintelligence_configure_native_pam_authentication.html
revdate: May 6, 2024
section_ids:
  configuring-ase-native-authentication: Configuring ASE native authentication
  about-this-task: About this task
  steps: Steps
  example: Example:
  configuring-linux-pam-authentication: Configuring Linux PAM authentication
  about-this-task-2: About this task
  steps-2: Steps
  example-2: Example:
  example-3: Example:
  recovering-ase-from-unavailable-pam-d-script: Recovering ASE from unavailable pam.d script
  about-this-task-3: About this task
  steps-3: Steps
  result: Result:
---

# Native and Pluggable Authentication Modules (PAM) authentication

API Security Enforcer (ASE) provides two types of authentication:

* Linux Pluggable Authentication Module (PAM)

* ASE native authentication (default method)

All actions carried out on ASE require an authenticated user.

The two methods to choose the authentication method include:

* Configure `auth_method` parameter in the `ase.conf` file. For more information, see ASE Initial Configuration.

* Run a command-line interface (CLI) command (`update_auth_method <method> `).

The following diagram shows the transition between authentication modes.

![Diagram of ASE authentication mode in communication with local database transitioning to PAM mode through CLI commands to show it is now connected to Linux PAM](../_images/nyn1564009011728.png)

|   |                                                                                  |
| - | -------------------------------------------------------------------------------- |
|   | The authentication method can be changed during run-time without restarting ASE. |

* Native authentication

* PAM authentication

## Configuring ASE native authentication

### About this task

By default, ASE uses native ASE authentication which ships with the system. Each user can run CLI commands by including the shared username and password with each command. The system ships with a default username (`admin`) and password (`admin`).

|   |                                                                                                                               |
| - | ----------------------------------------------------------------------------------------------------------------------------- |
|   | Always change the default password using the `update_password` command. For more information on ASE commands, see Appendix A. |

### Steps

* To configure `ase.conf` to support native authentication, use the default configuration values:

  ```
  auth_method=ase::db
  ```

* To change the authentication from native authentication to PAM mode, enter the following command in ASE command line:

  |   |                                                                  |
  | - | ---------------------------------------------------------------- |
  |   | In the example, `login` is a PAM script used for authentication. |

  ```
  /opt/pingidentity/ase/bin/cli.sh update_auth_method pam::login -u admin -p
   <password>
  ```

* To switch from PAM mode authentication back to native authentication, issue the following CLI command:

  ```
  /opt/pingidentity/ase/bin/cli.sh update_auth_method ase::db -u  <pam_user>  -p
   <password>
  ```

  #### Example:

  The following is an example of a CLI command with native authentication (-u,-p) enabled:

  ```
  /opt/pingidentity/ase/bin/cli.sh add_server -u admin -p
   <password>
  ```

## Configuring Linux PAM authentication

### About this task

PAM-based authentication provides the flexibility to authenticate administrators using existing authentication servers, such as your organization's Lightweight Directory Access Protocol (LDAP) *(tooltip: \<div class="paragraph">
\<p>An open, cross platform protocol used for interacting with directory services.\</p>
\</div>)* directory. When PAM authentication is active, ASE logs the identity of the user executing each CLI command. This provides a user-specific audit trail of administrative access to the ASE system.

### Steps

* To activate PAM-based authentication, configure `auth_method` in `ase.conf` as `pam::<service>,`where `<service>` is the script that the PAM module reads to authenticate the users.

  |   |                                                                                                                                       |
  | - | ------------------------------------------------------------------------------------------------------------------------------------- |
  |   | Service scripts include `login, su, ldap,` etc. For example, the `login` script allows all system users administrative access to ASE. |

* To support PAM authentication with the `login` script, update the `auth_method` configuration values in `ase.conf`:

  ```
  auth_method=pam::login
  ```

  #### Example:

  The following is an example using the CLI to change from Native to PAM authentication with `login` script:

  ```
  /opt/pingidentity/ase/bin/cli.sh update_auth_method pam::login -u admin -p
   <password>
  ```

  |   |                                                                                                                                                                      |
  | - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  |   | Make sure that the script name provided for PAM-based authentication is the correct one. If a wrong file name is provided, ASE administrators are locked out of ASE. |

* To write your own PAM module script, add a custom script, such as `ldap`, that defines PAM's behavior for user authentication to the `/etc/pam.d` directory.

* To set the authentication method and use the `ldap` script, run the following command:

  ```
  /opt/pingidentity/ase/bin/cli.sh update_auth_method pam::ldap -u admin -p
   <password>
  ```

  #### Example:

  In the following example, the PAM module uses the organization's LDAP server to authenticate users.

  ```
  root@localhost:/# cat /etc/pam.d/ldap
  auth   sufficient   pam_ldap.so     # Authenticate with LDAP server.
  #auth  sufficient   pam_permit.so   # Allow everyone. Pass-through mode.
  #auth  sufficient   pam_deny.so     # Disallow everyone. Block all access.
  ```

## Recovering ASE from unavailable pam.d script

### About this task

When an invalid script name is entered while changing to PAM authentication, the PAM module defaults to `etc/pam.d/others` for authentication. This makes ASE inaccessible to administrators. If this happens, you must recover ASE.

To recover ASE:

### Steps

1. Copy `etc/pam.d/login` to `etc/pam.d/other`.

   #### Result:

   ASE will use the credentials in `etc/pam.d/login` to authenticate administrators.

2. After signing back on to ASE, change the authentication method to use the correct file name.

   |   |                                                                                                                                |
   | - | ------------------------------------------------------------------------------------------------------------------------------ |
   |   | Copying the contents of `etc/pam.d/login` to `etc/pam.d/other` does not require a restart of ASE or the host operating system. |
