ARTIFACTORY: How can we reset user/password for remote repositories all at once in Artifactory Edge?

David Shin
2023-01-22 11:10

In some cases a password can be rotated/changed in your Artifactory instance suddenly.
This article will describe how to reset the username/password for remote repositories all at once in Artifactory Edge instance. 

Solution 1

When Artifactory Edge is up and running, to update the username and password for all remote repos, we  can use the api/system/configuration REST API

1. To get a current config, we can run curl -u admin localhost:8082/artifactory/api/system/configuration > config.xml
2. Replace the old username/password with the new username/password using your favorite Editing tool  vi config.xml

3. To update new config with new user/password, we can run     curl -u admin  localhost:8082/artifactory/api/system/configuration -XPOST -T config.xml 

Solution 2

When Artifactory Edge is not running, we can copy the artifactory.config.latest.xml to artifactory.config.import.xml 
and replace old user/password with new user/password in artifactory.config.import.xml
and restart the Artifactory Edge.