Issue
I have added an SSH credential to Jenkins.
Unfortunately, I have forgotten the SSH passphrase and would now like to obtain it from Jenkins' credential archive, which is located at ${JENKINS_HOME}/credentials.xml
.
That XML document seems to have credentials encrypted in XML tags <passphrase>
or <password>
.
How can I retrieve the plaintext passphrase?
Solution
Open your Jenkins' installation's script console by visiting http(s)://${JENKINS_ADDRESS}/script
.
There, execute the following Groovy script:
println( hudson.util.Secret.decrypt("${ENCRYPTED_PASSPHRASE_OR_PASSWORD}") )
where ${ENCRYPTED_PASSPHRASE_OR_PASSWORD}
is the encrypted content of the <password>
or <passphrase>
XML element that you are looking for.
Answered By - Abdull
Answer Checked By - Willingham (JavaFixing Volunteer)