I know this used to be a bug but im running an updated version (1.15) sshagent (credentials: ['mykey']) { sh 'ssh-add -l' sh 'git clone g...@bitbucket.org:my/repo.git' }
I even run ssh-add -l and can see its grabbing that key (already confirmed this key works outside of container) [Pipeline] sshagent [ssh-agent] Using credentials mykey (mykey) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) $ docker exec b9d2dbce9f672020317d915b42f8056bec1f3578e2e3875684bd860421d60283 env ssh- agent SSH_AUTH_SOCK=/tmp/ssh-fA1POfBXVEy5/agent.9 SSH_AGENT_PID=13 $ docker exec b9d2dbce9f672020317d915b42f8056bec1f3578e2e3875684bd860421d60283 env SSH_AGENT_PID=13 SSH_AUTH_SOCK=/tmp/ssh-fA1POfBXVEy5/agent.9 ssh-add /home/ jenkins/workspace/zzzzz@2@tmp/private_key_321144192289582899.key Identity added: /home/jenkins/workspace/zzzzz@2@tmp/ private_key_321144192289582899.key (/home/jenkins/workspace/zzzzz@2@tmp/ private_key_321144192289582899.key) [ssh-agent] Started. [Pipeline] { [zzzzz@2] Running shell script [Pipeline] sh + ssh-add -l 2047 SHA256:ZIkgMtEj9KtL4adcmxwsyiJBi3P+B0vSew+ufhUVOc0 /home/jenkins/ workspace/zzzzz@2@tmp/private_key_321144192289582899.key (RSA) [Pipeline] sh $ docker exec b9d2dbce9f672020317d915b42f8056bec1f3578e2e3875684bd860421d60283 env SSH_AGENT_PID=13 SSH_AUTH_SOCK=/tmp/ssh-fA1POfBXVEy5/agent.9 ssh-agent -k unset SSH_AUTH_SOCK; unset SSH_AGENT_PID; echo Agent pid 13 killed; [ssh-agent] Stopped. [zzzzz@2] Running shell script + git clone g...@bitbucket.org:my/repo.git Cloning into 'repo'... Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. [Pipeline] } [Pipeline] // sshagent [Pipeline] } What more do I have to do! -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/26f17129-632e-4a84-b05e-7db8e9cd5af8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.