Charles Findlay
Charles Findlay

Reputation: 33

jenkins-cli not authenticating with provided ssh private key

[Help]

Description of Problem jenkins-cli not authenticating with provided ssh private key

Observed

when passing the jenkins-cli command:

java -jar ~/jenkins-cli.jar -s http://localhost:8080 -i ~/.ssh/ccdevops who-am-i

The console output is:

Authenticated as: anonymous

Authorities:

Desired

Jenkins should authenticate as the user with the matching public key in their profile

Relevant Information

Steps Tried Already

Upvotes: 2

Views: 3184

Answers (1)

Michael J
Michael J

Reputation: 1543

You should also specify the SSH method and the user on the command line with -ssh and -user USER_NAME respectively. After that, your command would look like this:

java -jar ~/jenkins-cli.jar -s http://localhost:8080 -i ~/.ssh/ccdevops who-am-i -ssh -user USER_NAME

Also note that you'll need to be able to access the server via SSH as well.

Upvotes: 2

Related Questions