# Veeam Backup & Replication

# 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><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">- 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><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">- 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"><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><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">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"><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><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"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"></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"><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">  
</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><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">  
</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"><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">  
</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><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">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">  
</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><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">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>

# Application-Aware Processing

By default, Veeam Backup &amp; Replication does not process application logs and creates a crash-consistent backup of VMs with applications that use transaction logs for operations. You can create a transactionally consistent backup <span class="List_L1">—</span> in this case, Veeam Backup &amp; Replication will process application logs. In case a disaster strikes, Veeam Backup &amp; Replication will use backups of logs to perform recovery operations.

To create transactionally consistent backups or replicas of VMs that run the following applications, you must enable application-aware processing in job settings:

- <span class="List_L1">Microsoft Active Directory</span>
- <span class="List_L1">Microsoft SQL Server</span>
- <span class="List_L1">Microsoft SharePoint</span>
- <span class="List_L1">Microsoft Exchange</span>
- <span class="List_L1">Oracle</span>
- <span class="List_L1">PostgreSQL</span>

Application-aware processing is the Veeam technology that allows Veeam Backup &amp; Replication to prepare applications running on the VM and create a consistent view of application data on the VM guest OS. Once the application is ready, Veeam Backup &amp; Replication triggers the VM snapshot and starts to copy VM data to the target. Depending on the VM OS, Veeam Backup &amp; Replication utilizes the following technologies to create transactionally consistent backups:

- <span class="List_L1">For Windows-based VMs, </span><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> uses Microsoft Volume Shadow Copy Service (Microsoft VSS). Microsoft VSS ensures that there are no unfinished database transactions or incomplete application files. For more information, see </span>[Microsoft Docs](https://learn.microsoft.com/en-us/windows-server/storage/file-server/volume-shadow-copy-service)<span class="List_L1">.</span>
- <span class="List_L1">For Linux-based VMs, </span><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> uses the agent that connects to the VM guest OS and prepares databases and instances for a consistent backup.</span>

<span class="Subheading">Requirements and Limitations</span>

Application-aware processing is supported for Linux-based VMs and Microsoft Windows client versions starting from Windows Vista and for server versions starting from Windows Server 2008. To use application-aware processing, you must have VMware Tools and the latest updates installed on the VM guest OS. For more information on supported guest OS versions, see [Supported Applications](https://helpcenter.veeam.com/docs/backup/vsphere/platform_support.html#guest).

<div id="bkmrk-important-if-a-vm-ru"><table class="Important"><tbody><tr><td><span class="T_ImportantType">Important</span>

</td></tr><tr><td><span class="Notes">If a VM runs an application that does not support Microsoft VSS (there is no VSS writer for this particular type of application, for example, MySQL), </span><span class="Notes">Veeam Backup &amp; Replication</span><span class="Notes"> will not be able to utilize Microsoft VSS and application-aware processing for this VM. To process such VMs, you can use </span><span class="Notes">VMware Tools</span><span class="Notes"> quiescence with pre-freeze and post-thaw scripts. For more information, see </span>[VMware Tools Quiescence](https://helpcenter.veeam.com/docs/backup/vsphere/tools_quiescence.html)<span class="Notes"> and </span>[Pre-Freeze and Post-Thaw Scripts](https://helpcenter.veeam.com/docs/backup/vsphere/pre_post_scripts.html)<span class="Notes">.</span>

</td></tr></tbody></table>

</div><a name="Windows"></a><span class="Subheading">How Application-Aware Processing Works for Windows-Based Machines</span>

<a></a>If you enable application-aware processing in job settings, Veeam Backup &amp; Replication performs the following operations as a part of the backup or replication process:

1. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> deploys the non-persistent runtime components or, if necessary, persistent agent components on the VM and detects if the VM runs any of the supported applications.</span>
2. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> collects information about applications installed on VMs — this information is required for VSS-aware restore.</span>

<a></a><span class="List_L1_Paragraph">VSS-aware restore is performed when the VM is started after you restore it from the backup or fail over to a VM replica.</span>

1. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> prepares applications for VSS-aware restore.</span>
2. <a></a><span class="List_L1">Microsoft VSS communicates with applications and freezes I/O activities at a specific point in time.</span>
3. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> acts as a VSS requestor and triggers a VM VSS snapshot.</span>
4. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> triggers a </span><span class="List_L1">VMware vSphere</span><span class="List_L1"> snapshot of the VM.</span>
5. <a></a><span class="List_L1">Microsoft VSS resumes frozen I/O activities on the VM guest OS.</span>
6. <a></a><span class="List_L1">The job session proceeds as usual.</span>
7. <a></a><span class="List_L1">If you have instructed </span><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> to truncate transaction logs, </span><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> truncates transaction logs on the VM guest OS after the backup or replica is successfully created.</span>

<a></a>![Application-Aware Processing](https://helpcenter.veeam.com/docs/backup/vsphere/images/application_aware_processing.png)

<a name="Linux"></a><span class="Subheading">How Application-Aware Processing Works for PostgreSQL</span>

<a></a>If you enable application-aware processing in job settings, Veeam Backup &amp; Replication performs the following operations as a part of the backup or replication process

1. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> installs either non-persistent components or persistent agent components to the VM guest OS and detects if the VM runs any of the supported applications.</span>

<div class="List_L1_Paragraph" id="bkmrk-note-by-default%2C-vee"><table class="Note"><tbody><tr><td><span class="T_NoteType">Note</span>

</td></tr><tr><td><span class="Notes">By default, Veeam Backup &amp; Replication installs non-persistent components to the VM guest OS and uninstalls them after the job completes. You can also install a Linux management agent to the VM guest OS — in this case, the agent will remain installed on the VM and Veeam Backup &amp; Replication will use it to access the VM guest OS instead of SSH. For more information, see </span>[Persistent Agent Components](https://helpcenter.veeam.com/docs/backup/vsphere/persistent_agent_components.html)<span class="Notes">.</span>

</td></tr></tbody></table>

</div>1. <a></a><span class="List_L1">The pgsqlagent agent looks for PostgreSQL instance configuration files. It uses these files to get information on the PostgreSQL instance settings.</span>

<div class="List_L1_Paragraph" id="bkmrk-note-by-default%2C-con"><table class="Note"><tbody><tr><td><span class="T_NoteType">Note</span>

</td></tr><tr><td><span class="Notes">By default, configuration files are located in the following directories:</span>

- <span class="Note_List">\[For Ubuntu, Debian\] — </span><span class="T_Filenames">/etc/</span>
- <span class="Note_List">\[For RHEL, SLES\] — </span><span class="T_Filenames">/var/lib/</span>

<span class="Notes">If you keep the configuration file in the custom directories or if you want to exclude some directories from the scan, you can manually create the </span><span class="T_Filenames">/etc/veeam/VeeamPostgreSQLAgent.xml</span><span class="Notes"> file. In this case, the pgsqlagent agent will use commands from this file. To explicitly include or exclude specific configuration files from rescan, add the following commands to the /</span><span class="T_Filenames">etc/veeam/VeeamPostgreSQLAgent.xml</span><span class="Notes"> file:</span>

- <span class="T_Filenames">ExcludeConfigDirs</span><span class="Note_List"> — use this command to exclude configuration files.</span>
- <span class="T_Filenames">AddConfigDirs</span><span class="Note_List"> — use this command to include configuration files.</span>

<span class="Notes">Note that you must embed the commands into the </span><span class="T_Filenames">&lt;config /&gt;</span><span class="Notes"> tag. To specify several directories, separate them by a comma.</span>

<span class="Notes">For example: </span><span class="T_Filenames">&lt;config ExcludeConfigDirs="/etc/postgresql/13/cl4/,/etc/postgresql/13/cl6/" AddConfigDirs="/home/user/pgconfdir/"/&gt;</span><span class="Notes">.</span>

<span class="Notes">This command skips 2 directories and includes 1 custom directory.</span>

</td></tr></tbody></table>

</div>1. <a></a><span class="List_L1">The pgsqlagent agent returns a list of PostgreSQL configuration files to </span><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1">.</span>
2. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> accesses the PostgreSQL VM guest OS over SSH or over management agent.</span>
3. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> connects to the PostgreSQL instance, gets a list of databases added to the instance and information that is necessary for data recovery operations.</span>
4. <a></a><span class="List_L1">The pgsqlagent agent sets the PostgreSQL instance to the ready for a backup state.</span>
5. <a></a><span class="List_L1">Agent freezes the VM guest OS and creates a snapshot of the PostgreSQL instance.</span>
6. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> completes a backup of the PostgreSQL instance and resumes stopped activities on the VM guest OS.</span>
7. <a></a><span class="List_L1">Veeam Backup &amp; Replication</span><span class="List_L1"> saves a backup of a machine with a PostgreSQL instance to a backup repository.</span>

[https://helpcenter.veeam.com/docs/backup/vsphere/application\_aware\_processing.html?ver=120](https://helpcenter.veeam.com/docs/backup/vsphere/application_aware_processing.html?ver=120)

# Lizenznutzungsbericht

Um eine vollständige Serverlsite aller Backup Jobs zu erhalten:

[![image.png](https://docs.corestream.ch/uploads/images/gallery/2024-12/scaled-1680-/vxQM31iEWWyGYIsN-image.png) ](https://docs.corestream.ch/uploads/images/gallery/2024-12/vxQM31iEWWyGYIsN-image.png)

[![image.png](https://docs.corestream.ch/uploads/images/gallery/2024-12/scaled-1680-/hoJ3nKqWxuRUaJGt-image.png)](https://docs.corestream.ch/uploads/images/gallery/2024-12/hoJ3nKqWxuRUaJGt-image.png)

[![image.png](https://docs.corestream.ch/uploads/images/gallery/2024-12/scaled-1680-/mpkiy1nPnC439JM3-image.png)](https://docs.corestream.ch/uploads/images/gallery/2024-12/mpkiy1nPnC439JM3-image.png)

[![image.png](https://docs.corestream.ch/uploads/images/gallery/2024-12/scaled-1680-/4HIxhX9GRAWhP8nn-image.png)](https://docs.corestream.ch/uploads/images/gallery/2024-12/4HIxhX9GRAWhP8nn-image.png)

# Version 12