# SSPI authentication failed for user

## Challenge

When the Veeam Backup &amp; Replication Configuration Database is using PostgreSQL, direct interaction with the database may fail with the error:

```
SSPI authentication failed for user
```

Interactions where this may occur include:

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-installing-an-update"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--default--12 "><div class="veeam-text text aem-GridColumn aem-GridColumn--default--12"><div class=" veeam-component__component-spacing-below--lg"><div class="veeam-text  veeam-text--adaptive-mode" data-component="VeeamTextComponent" data-initialized="true">- Installing an update to Veeam Backup &amp; Replication.  
    Related: [KB4543:"Failed to connect to the database." Updater Configuration Check](https://www.veeam.com/kb4543)
- Performing a [configuration restore](https://helpcenter.veeam.com/docs/backup/vsphere/vbr_config_restore.html).
- Attempting to interact directly with the database (e.g., using pgAdmin or pgsql commands).

</div></div></div></div></div></div></div></div></div>## Cause

This error occurs when the account being used to perform the interaction is not authorized to access the Veeam Backup &amp; Replication configuration database within the PostgreSQL instance.

When PostgreSQL is deployed by the Veeam Backup &amp; Replication installer, that PostgreSQL database engine is configured to use [SSPI Authentication](https://www.postgresql.org/docs/current/sspi-auth.html), which allows for access authentication using Windows accounts. The pg\_ident.conf file, which maps Windows accounts to the postgres root user account, is updated to add Windows accounts that should have access to the configuration database.

By default, the following Windows accounts are added as authorized to access the database directly:

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-the-windows-account-"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--tablet--12 aem-Grid--default--12 aem-Grid--phone--12 "><div class="veeam-text text aem-GridColumn aem-GridColumn--default--12"><div class=" veeam-component__component-spacing-below--md"><div class="veeam-text  veeam-text--adaptive-mode" data-component="VeeamTextComponent" data-initialized="true">- The Windows account that was used during the initial install.
- The NT AUTHORITY\\SYSTEM account, which is the default account used by the Veeam Backup &amp; Replication services.

</div></div></div><div class="notice-component parbase aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class="notice-component--spacing  veeam-component__component-spacing-below--lg" data-component="NoticeComponent" data-initialized="true"><div class="notice notice--warning"><div class="notice__icon">  
</div><div class="notice__content"><div class="notice__title">Hostname Change Impact</div><div class="notice__text veeam-text">If Veeam Backup &amp; Replication was deployed using a local administrator account, and the hostname was changed after the software was installed, the entry for that local account within the pg_ident.conf file will be invalid.</div></div></div></div></div></div></div></div></div></div></div>## Solution

#### **Option 1:** Use an Existing Authorized Windows Account

Identify which accounts are currently authorized to access the Veeam Backup &amp; Replication configuration database, and perform the action as that user.

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-open-the-following-f"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--tablet--12 aem-Grid--default--12 aem-Grid--phone--12 "><div class="veeam-text text aem-GridColumn aem-GridColumn--default--12"><div class=" veeam-component__component-spacing-below--ss"><div class="veeam-text  veeam-text--adaptive-mode" data-component="VeeamTextComponent" data-initialized="true">1. Open the following file in a text editor: ```
    C:\Program Files\PostgreSQL\15\data\pg_ident.conf
    ```
2. At the bottom of the file, you will find at least two uncommented lines with a format similar to this example\*: ```
    veeam   User@Domain   postgres
    ```
    
    *<sub>\*If the PostgreSQL instance was created by the Veeam Backup &amp; Replication installer. If the PGSQL Instance was user-created, the mapname and pg-username may be different.</sub>*
3. Use the non-SYSTEM account to perform the action that initially failed with the SSPI error.

</div></div></div><div class="code-block aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class="code-block  veeam-component__component-spacing-below--ss" data-component="CodeBlockComponent" data-initialized="true"><div class="code-toolbar"></div></div></div></div></div></div></div></div></div>```bash
# Put your actual configuration here
# ----------------------------------
# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
veeam   Backupsvc@DOMAIN   postgres
veeam   "SYSTEM@NT AUTHORITY"   postgres

```

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-copy-example-pg_iden"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--tablet--12 aem-Grid--default--12 aem-Grid--phone--12 "><div class="code-block aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class="code-block  veeam-component__component-spacing-below--ss" data-component="CodeBlockComponent" data-initialized="true"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--lg"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true"><div>*Example pg\_ident.conf File*</div></div></div></div><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--ss"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true">  
</div></div></div></div></div></div></div></div></div>#### **Option 2:** Add a Windows Account to The Authorized Users Lists

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-security-considerati"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--tablet--12 aem-Grid--default--12 aem-Grid--phone--12 "><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--ss"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true">  
</div></div></div><div class="notice-component parbase aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class="notice-component--spacing  veeam-component__component-spacing-below--ss" data-component="NoticeComponent" data-initialized="true"><div class="notice notice--warning"><div class="notice__icon">  
</div><div class="notice__content"><div class="notice__title">Security Considerations</div><div class="notice__text veeam-text">For day-to-day tasks involving Veeam Backup &amp; Replication, a user does **not** need direct access to the Configuration Database. Therefore, from a security standpoint, it may be best to only add accounts to the pg_ident.conf file when absolutely necessary. (Consider assigning a single account as the account that will be used for performing Veeam Backup &amp; Replication updates or Configuration Restores.) </div></div></div></div></div><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--lg"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true">  
</div></div></div></div></div></div></div></div></div>##### **Identify Which Account Was in Use When the SSPI Error Occurred**

*These steps assume the SSPI error has recently occurred and is still in the latest log folder.*

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-navigate-to-the-post"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--tablet--12 aem-Grid--default--12 aem-Grid--phone--12 "><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--lg"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true">1. Navigate to the PostgreSQL log folder.  
    The default PostgreSQL 15 path: **C:\\Program Files\\PostgreSQL\\15\\data\\log**
2. Sort the folder contents by last modified, and open the latest log file.
3. Scroll to the end of the log file and begin scrolling up. Look for entries like this: ```
    LOG:  <strong>no match in usermap</strong> "veeam" for user "postgres" authenticated as <strong>"pgadmin@VBR12"</strong>
    <strong>FATAL:  SSPI authentication failed</strong> for user "postgres"
    ```
4. Take note of the account indicated in the error.  
    (In the example above, the account *pgadmin@VBR12* is listed at the very end of line 1.)

</div></div></div><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--lg"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true">  
</div></div></div></div></div></div></div></div></div>##### **Add Windows Account to pg\_ident.conf**

<div class="section-component parbase aem-GridColumn aem-GridColumn--default--12" id="bkmrk-open-the-mappings-fi"><div class=" veeam-component__component-spacing-below--sm"><div class="section    "><div class="bg-image-size-contain bg-image-position-left      "><div class="  "><div class="aem-Grid aem-Grid--12 aem-Grid--tablet--12 aem-Grid--default--12 aem-Grid--phone--12 "><div class="veeam-text text aem-GridColumn--tablet--12 aem-GridColumn--offset--tablet--0 aem-GridColumn--default--none aem-GridColumn--phone--none aem-GridColumn--phone--12 aem-GridColumn--tablet--none aem-GridColumn aem-GridColumn--default--12 aem-GridColumn--offset--phone--0 aem-GridColumn--offset--default--0"><div class=" veeam-component__component-spacing-below--lg"><div class="veeam-text  " data-component="VeeamTextComponent" data-initialized="true">5. Open the mappings file in a text editor: ```
    C:\Program Files\PostgreSQL\15\data\pg_ident.conf
    ```
6. Add a new line at the bottom of the file in the following format:  
    *<sup>Replacing pgadmin@VBR12 with the account you identified in your logs on Step 4.</sup>*  
    ```
    veeam   pgadmin@VBR12   postgres
    ```
    
    [https://www.veeam.com/kb4542](https://www.veeam.com/kb4542)

</div></div></div></div></div></div></div></div></div>