Recover CloudStack Database Password

If you ever need to get back your CloudStack database password, you can easily do so as below:

  1. Grab the encrypted password from /etc/cloudstack/management/db.properties
    [root@csman2-1 ~]# grep ^db.cloud.pass /etc/cloudstack/management/db.properties 
    db.cloud.password=ENC(tFogV+Zf2JGHSquhVOumuA==)
    
  2. Retrieve the management key from the file /etc/cloudstack/management/key
    [root@csman2-1 ~]# cat /etc/cloudstack/management/key
    password
    
  3. Finally, decrypt the database password
    [root@csman2-1 ~]# java -classpath /usr/share/cloudstack-common/lib/jasypt-1.9.0.jar org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI decrypt.sh input=tFogV+Zf2JGHSquhVOumuA== password=password verbose=true
    
    ----ENVIRONMENT-----------------
    
    Runtime: Sun Microsystems Inc. OpenJDK 64-Bit Server VM 20.0-b12 
    
    ----ARGUMENTS-------------------
    
    verbose: true
    input: tFogV+Zf2JGHSquhVOumuA==
    password: password
    
    ----OUTPUT----------------------
    
    cloud
    

Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

More Posts - Website

Follow Me:
TwitterLinkedIn

Published by

Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

One thought on “Recover CloudStack Database Password”

Leave a Reply