Resetting Forgotten Postgres password

Resetting Forgotten Postgres password

            When the customer has altered the postgres user password and forgotten on how to retrive it. Please follow the below procedure to Reset Postgres SuperUser Password. This case will be helpful in case of forgotten old password, for changing the password if you know the old password, please refer this article.
Note: Please try to avoid sharing the Postgres user password to customers directly due to security reasons.
  1. Open the pg_hba.conf file, located at <servicedeskplus_home>\pgsql\data\ folder and edit the authentication method for the postgres user to "trust".  The default authentication method is md5, but we need to change it to trust. This will allow to connect to PostgreSQL without a passwordSave the changes to the pg_hba.conf file.
Make sure that you have a backup of the pg_hba.conf file before you make any changes.
      2. Restart the PostgreSQL server. 
      3. Connect to PostgreSQL as the postgres user by the following command. You will not be prompted for a password.
./psql -h 127.0.0.1 -p 65432 -d servicedesk -U postgres
      4. Execute the below command to Alter the postgres password.
ALTER USER postgres WITH PASSWORD '<new password>';
Additionally for altering sdpadmin password, 
ALTER USER sdpadmin WITH PASSWORD '<new password>';
      5. Revert the changes done in pg_hba.conf. (i-e: change authentication method back to md5)  and Restart the Postgresql Server. 
Now application will connect to DB with new user credentials.

        New to ADManager Plus?

          New to ADSelfService Plus?

            • Related Articles

            • How to Connect External Postgres

              Install a External Postgres such that the version of that postgres is currently in the series of inbuilt postgres of our Application. Say for example, In Servicedeskplus Application version 14010, which has postgres version 10.21, then you should ...
            • How to reset administrator password in ServiceDesk Plus.

              1. Access your ServiceDesk Plus server and browse to [your drive]:\ManageEngine\ServiceDesk\bin. 2. Click changeDBServer.bat. Information on the configured database will be displayed.   If the database is MSSQL, go to the SQL Management Studio, go to ...
            • Script to reset password and enable local authentication

              Purpose : Interactive mode of resetting the password of a user by entering his username. Also, to enable local authentication in the application. This script can be used in builds on or above 9400 version How the script works ? Invoking the script ...
            • Remote read only access to database for Postgres customers

              Frequently customers want to connect some reporting / dashboard application like PowerBI or Tableau with our Postgres database server. By default, the bundled Postgres is configured to only listen to the local machine. We can configure to allow ...
            • FATAL : Password Authentication failed for user "postgres"

              Log Trace : FATAL: password authentication failed for user "postgres" Analysis : During the major upgrade of Postgres say 10.21(From 13006) to 11.17 (From 14300), the Postgres upgrade fails with the above trace due to password authentication failure ...