Unable to point to ssh keys in ~/.ssh on Jenkins host

不打扰是莪最后的温柔 提交于 2019-12-21 04:04:52

问题


I've installed SSH Agent Plugin to pull Git repository using SSH authentication. I'd like to use SSH keys located in system file (from the Jenkins master ~/.ssh option). It's screenshot taken from official plugin's page:

Unfortunately I don't see this option. I can select only "Enter directly". Please check out my screenshot.

Did I configure something wrong?


回答1:


This is a reletively recent change, explained in security advisory 440 : https://jenkins.io/security/advisory/2018-06-25/

SECURITY-440 / CVE-2018-1000601 SSH Credentials Plugin allowed the creation of SSH credentials with keys "From a file on Jenkins master". Credentials Binding Plugin 1.13 and newer allows binding SSH credentials to environment variables. In combination, these two features allow users with the permission to configure a job to read arbitrary files on the Jenkins master by creating an SSH credential referencing an arbitrary file on the Jenkins master, and binding it to an environment variable in a job.

SSH Credentials Plugin no longer supports SSH credentials from files on the Jenkins master file system, neither user-specified file paths nor ~/.ssh. Existing SSH credentials of these kinds are migrated to "directly entered" SSH credentials.




回答2:


That option (first screen) is from the Jenkins | Manage Jenkins | Manage Credentials global option page.

If it not visible inside a Jenkins job.

You need to enter at least one named private key, in order for a job to display the option:




回答3:


I also din't see the "Manage Credentials" Options. I'm still tinkering.. see below

My current location

Jenkins > credentials > system > global credentials
its not very obvious how to get here.. so, here are some hacks/ work arounds.

global credentials link isn't very obvious.. see screen shot or type in browser the path below
YOURIP:YOURPORT/credentials/store/system/domain/_/

Once at location: you should see Add Credentials in sidebar menu or href text link "adding some credentials?"

I see 1 SSH option here. "SSH with username and Private Key"

will update results.



来源:https://stackoverflow.com/questions/51119412/unable-to-point-to-ssh-keys-in-ssh-on-jenkins-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!