Changing the default VMware vCenter Server Appliance database password
search cancel

Changing the default VMware vCenter Server Appliance database password

book

Article ID: 313577

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article provide steps to change the default password of VMware vCenter Server Appliance database when required or if the password is compromised.

Environment

VMware vCenter Server 7.0.x
VMware vCenter Server Appliance 6.0.x
VMware vCenter Server Appliance 5.1.x
VMware vCenter Server Appliance 6.5.x
VMware vCenter Server Appliance 5.5.x
VMware vCenter Server 6.7.x

Resolution

To change the default password:

  1. Change the embedded database password:
     
    1. Connect to the vCenter Server Appliance using SSH.
    2. Open the embedded_db.cfg file by running this command:

      vi /etc/vmware-vpx/embedded_db.cfg
       
    3. In the file, locate EMB_DB_'PASSWORD' and change the password between the single quotation marks.
    4. Open the /etc/vmware-vpx/vcdb.properties file for editing with the following command:

      vi /etc/vmware-vpx/vcdb.properties
       
    5. Change the database password listed here.
       
  2. Change the password for the vc and postgres database users:
     
    1. Connect to the vPostgres database for SQL execution by running this command:

      /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
       
    2. Run these SQL statements to change the passwords for the vc and postgres users:

      alter user postgres with password 'new-password';
      alter user vc with password 'new-password';

       
    3. Exit the database by running this command:

      \q
       
    4. Open the .pgpass file by running this command:

      vi /root/.pgpass
       
    5. Modify the .pgpass file with the new password:

      localhost:5432:VCDB:postgres:new-password
      localhost:5432:postgres:postgres:new-password
      localhost:5432:VCDB:vc:new-password
  3. Update the encrypted password in the vpxd.cfg file by running this command:

    /usr/sbin/vpxd -p
     
  4. Enter the password when prompted.
  5. Run this command to restart the vpxd service:

    /etc/init.d/vmware-vpxd restart