8

I'm using the jenkins-cli.jar file from my jenkins server, and on every run it prompts me for my ssh key passphrase. I'd like it to use my ssh keychain so I don't have to enter it on every invocation.

If it matters, I'm on OSX using the default keychain setup, I don't have a manual ssh-agent configured right now.

Daenyth
  • 35,856
  • 13
  • 85
  • 124

1 Answers1

8

Jenkins CLI client does not support SSH agents for now.

As a workaround, you can generate dedicated key without passphrase, associate it with your Jenkins account and instruct client to use that key on every invocation.

Oliver Gondža
  • 3,386
  • 4
  • 29
  • 49
  • 1
    And here is the bug tracking this issue https://issues.jenkins-ci.org/browse/JENKINS-45320 -- feel free to comment there. – sorin Jul 05 '17 at 16:53
  • Until now it was not improved, perhaps there is a special plugin that solved this? – Manuel Jordan Aug 02 '21 at 17:12
  • 1
    @ManuelJordan, Jenkins CLI client (part of Jenkins core) needs to have the support for local SSH agent. Plugins cannot contribute such logic. They can implement alternative CLI client, though, but I am not aware of anyone that would. – Oliver Gondža Aug 08 '21 at 20:03
  • @OliverGondža Thanks for the feedback, in the JIRA issue remains without solution. If the `" SSH-based CLI with regular SSH clients"` can be really improved to have the same set of features like the `java -jar` approach would be excellent. I think I am going to create a JIRA issue about that. – Manuel Jordan Aug 09 '21 at 00:38