How to Change the Java Keystore Password

  • KM03694423
  • 27-Aug-2020
  • 27-Aug-2020

Summary

For security purposes it might be desirable to change the Java keystore password

Question

By default the keystore password in Java is 'changit'.

For security purposes it might be desirable to change the Java keystore password to something different

 

Answer

Linux Format: <path>/keytool -storepasswd -keystore /<path>/cacerts

For Example...

/usr/java/jdk1.8.0_251-amd64/bin/keytool -storepasswd -keystore /usr/java/jdk1.8.0_251-amd64/jre/lib/security/cacerts

Windows Format: <path>\keytool.exe -storepasswd -keystore \ "<path>\cacerts"

For Example...

"C:\Program Files\Java\jre1.8.0_261\bin\keytool.exe" -storepasswd -keystore "C:\Program Files\Java\jre1.8.0_261\lib\security\cacerts"

The screen prompts will be as follows...

Enter keystore password:  changeit
New keystore password:  new-password
Re-enter new keystore password:  new-password

Mind that a file an application uses to authenticate to the 'cacerts' will likely need to be changed.
For example, in ALM and Octane, which uses Jetty, the file "jetty-ssl.xml"
Refer to the product documentation for more information.