This question already has an answer here:
So I have a few servers set up behind a bastion. I usually hop from bastion -> server A -> server B using agent forwarding. One day I try to log into server B and for no reason apparent to me I gives me: Permission denied (publickey).
After fiddling around trying to get it to work I figure I must have somehow messed up some setting in the ~/.ssh folder on server B, or some other config files. So I go ahead and end up reverting back to a backup of server B.. same thing.
After much googling and frustration I end up reverting back to the last known backup I have of all 3 taken at the same time (it DEFINITELY worked then). After reverting back the bastion, server A and server B I get the same thing! I can get into the bastion, get into A, but I get permission denied when trying to get into B. I'm at a total loss for what could be going on.
Does anyone have ANY idea what could be going on? Any words of advice would be amazing!!
spencer@ip-10-0-1-10:~$ ssh -Av 10.0.1.65 OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to 10.0.1.65 [10.0.1.65] port 22. debug1: Connection established. debug1: identity file /home/spencer/.ssh/id_rsa type -1 debug1: identity file /home/spencer/.ssh/id_rsa-cert type -1 debug1: identity file /home/spencer/.ssh/id_dsa type -1 debug1: identity file /home/spencer/.ssh/id_dsa-cert type -1 debug1: identity file /home/spencer/.ssh/id_ecdsa type -1 debug1: identity file /home/spencer/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/spencer/.ssh/id_ed25519 type -1 debug1: identity file /home/spencer/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubu ntu-2ubuntu2.3 debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x040 00000 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr email@example.com none debug1: kex: client->server aes128-ctr firstname.lastname@example.org none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ECDSA 65:dc:c0:4f:13:30:60:4d:0d:5e:c9:e2:53:b9:8f:62 debug1: Host '10.0.1.65' is known and matches the ECDSA host key. debug1: Found key in /home/spencer/.ssh/known_hosts:2 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: imported-openssh-key debug1: Authentications that can continue: publickey debug1: Trying private key: /home/spencer/.ssh/id_rsa debug1: Trying private key: /home/spencer/.ssh/id_dsa debug1: Trying private key: /home/spencer/.ssh/id_ecdsa debug1: Trying private key: /home/spencer/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey).