Search code examples
jenkinsjenkins-pluginsssh-agent

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


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:

Screen from official plugin's page

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

my screenshot

Did I configure something wrong?


Solution

  • 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.