ARTIFACTORY: How to restore your remote repository password?

Roi Niv
2022-08-03 11:18

All your remote repositories passwords can be found inside the artifactory.config.latest.xml file (under $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.config.latest.xml).
 
The passwords are encrypted inside the artifactory.config.latest.xml file, and we need to be able to decode them so we can find the relevant password.
 
This can be achieved by using the Deactivate Artifactory Key Encryption REST API , once the REST API is executed, all the passwords in the artifactory.config.latest.xml file will be displayed as plain text. 
For example :<remoteRepository>
   <key>my-remote-repository</key>
   <type>generic</type>
....
   <username>USER</username>
   <password>PLAIN_TEXT_PASSWORD</password>
....
 </remoteRepository>

The command should look like this:curl -u<username>:<password> -XPOST http://<URL>:8082/artifactory/api/system/decrypt
Note that a valid admin user is required to run the REST API.
 
To encrypt the passwords again, run the Activate Artifactory Key Encryption REST API.
 
For example:curl -u<username>:<password> -XPOST http://<URL>:8082/artifactory/api/system/encrypt