How can I get jenkins-cli.jar to use my ssh agent/keychain?
Asked Answered
C

1

9

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.

Cash answered 12/6, 2015 at 15:16 Comment(0)
H
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.

Hiroshige answered 20/6, 2015 at 9:50 Comment(4)
And here is the bug tracking this issue issues.jenkins-ci.org/browse/JENKINS-45320 -- feel free to comment there.Chemoreceptor
Until now it was not improved, perhaps there is a special plugin that solved this?Genuine
@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.Dwanadwane
@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.Genuine

© 2022 - 2024 — McMap. All rights reserved.