I am trying to run groovysh on my Jenkins from the cli, using the following command:
java -jar jenkins-cli.jar -s <Jenkins URL> -i JenkinsPrivateKey.ppk groovysh
I generated this private key file using PuttyGen, and pasted the public key into the SHH Public Keys box on the /me/configure page of the Jenkins. It's not that the key doesn't work - it seems like it's not authenticating at all. When I run who-am-i using the cli:
java -jar jenkins-cli.jar -s <Jenkins URL> -i JenkinsPrivateKey.ppk who-am-i
It gives me a response of:
Authenticated as: anonymous
What am I missing here? I thought if the authentication failed it would at least display an error message of some kind. Is there any way to verify that the private key actually works?
Edit: After some experimentation, it seems that authentication via the CLI does fail silently - I put a bogus public key in my profile configuration, and I still saw no error.