I have two EC2 instances:
Serve 1, OS: Centos - 7.5 Serve 2, OS: Centos - 7.5 Default username: centos
Both are configured for passwordless login, so I have the ssh key with me.
I am able to ssh to both servers using the ssh key from my host.
But when I am trying to ssh from Server 1 to Server 2, it's failing.
I found out that the private keys are under /etc/ssh
-rw-r-----. 1 root ssh_keys 1679 Oct 7 14:42 ssh_host_rsa_key
Error
sudo ssh -i ./ssh_host_rsa_key [email protected]
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
So where I am going wrong?