Bootstrap FreeKB - Java - Change keystore or truststore password using the java keytool command
Java - Change keystore or truststore password using the java keytool command

Updated:   |  Java articles

If you are not familiar with the Java keytool command, check out our Getting Started article.

Let's say you have a Java keystore or truststore file named "trusted_certs" in the /usr/local/certs directory. If the Java keystore or truststore is password protected, you will be prompted for the password.

~]$ keytool -list -keystore "/usr/local/certs/trusted_certs"
Enter keystore password:

 

Or, the -storepass option can be used to provide the password on the command line.

keytool -keystore cacerts -storepass itsasecret -list

 

The -storepasswd option can be used to update the password that is used for the Java keystore or truststore file.

~]$ keytool -keystore cacerts -storepasswd
Enter keystore password:  <current password>
New keystore password: <new password>
Re-enter new keystore password: <new password>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter d08e8f in the box below so that we can be sure you are a human.