So I am trying to set up a ssh key for Jenkins. For some reason I am getting:
Permission denied (publickey).
The full stack trace is:
[jenkins@ip-xx-xx-xx-xxx .ssh]$ ls
authorized_keys id_rsa id_rsa.pub known_hosts
[jenkins@ip-xx-xx-x-xxx .ssh]$ ssh -vT ddennis@git.xxxxxx.com
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to git.viasat.com [xx.xx.xxx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/jenkins/.ssh/id_rsa type 1
debug1: identity file /home/jenkins/.ssh/id_rsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_dsa type -1
debug1: identity file /home/jenkins/.ssh/id_dsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_ecdsa type -1
debug1: identity file /home/jenkins/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_ed25519 type -1
debug1: identity file /home/jenkins/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: kex: ecdh-sha2-nistp256 need=20 dh_need=20
debug1: kex: ecdh-sha2-nistp256 need=20 dh_need=20
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA aa:f3:39:39:58:2b:61:ad:e8:d3:7a:f2:d2:e9:dd:7a
debug1: Host 'git.xxxxxx.com' is known and matches the ECDSA host key.
debug1: Found key in /home/jenkins/.ssh/known_hosts:3
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/jenkins/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/jenkins/.ssh/id_dsa
debug1: Trying private key: /home/jenkins/.ssh/id_ecdsa
debug1: Trying private key: /home/jenkins/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
I have the ssh key set up as my user in git as well.
I ran:
[jenkins@ip-xx-xx-xx-xxx .ssh]$ ssh-add -l
4096 9e:93:0c:12:4c:74:a6:e4:f0:eb:a1:28:d4:44:46:71 /home/jenkins/.ssh/id_rsa (RSA)
on my slave node and it matched the one that was loaded into git.
I also did a copy of that key into my authorized key file.
Been playing around with this for a while any advice is helpful.