# How to configure the PAM authentication in Postgres 12

**URL:** <https://forums.percona.com/t/how-to-configure-the-pam-authentication-in-postgres-12/31106>\
**Category:** Uncategorized\
**Created:** [June 19, 2024, 3:40pm UTC](https://forums.percona.com/t/how-to-configure-the-pam-authentication-in-postgres-12/31106 "2024-06-19T15:40:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balaji](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@Balaji](https://forums.percona.com/u/Balaji)\
**Post date:** [June 19, 2024, 3:40pm UTC](https://forums.percona.com/t/how-to-configure-the-pam-authentication-in-postgres-12/31106/1 "2024-06-19T15:40:19Z")

</div>

Hello Guys,  
I am new to the Postgres.  
I want to configure the PAM authentication. How we will configure the PAM .  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)\
**Post date:** [June 27, 2024, 1:19am UTC](https://forums.percona.com/t/how-to-configure-the-pam-authentication-in-postgres-12/31106/2 "2024-06-27T01:19:08Z")

</div>

Hi Balaji,

Did you check the online documentation on it?

> **[21.13. PAM Authentication](https://www.postgresql.org/docs/current/auth-pam.html)**
>
> 21.13. PAM Authentication # This authentication method operates similarly to password except that it uses PAM (Pluggable Authentication Modules) as the …

We also have a blogpost on it:

> **[PostgreSQL Database Security: OS - Authentication](https://www.percona.com/blog/postgresql-database-security-os-authentication/)**
>
> Discussing the three operating system-based authentication methods for PostgreSQL; Ident, PAM, and Peer.

You can also use a line like the following in your pg\_hba.conf file to use ssl/tls:

```auto
hostssl all all 0.0.0.0/0 pam pamservice=postgresql

```

---

<div class="post-metadata">

**Author:** ![Balaji](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@Balaji](https://forums.percona.com/u/Balaji)\
**Post date:** [July 5, 2024, 9:11am UTC](https://forums.percona.com/t/how-to-configure-the-pam-authentication-in-postgres-12/31106/3 "2024-07-05T09:11:56Z")

</div>

Hi @Agustin_G ,  
I gone through it.  
How we can add AD user groups here.  
For ex: I have group name like DB\_RO and DB\_WRITE.  
Under each this AD group( DB\_RO and DB\_WRITE) we have 40+ users.

Then how can i add these AD groups to this PAM?

Regards,  
Balaji
