I was using ssh client from mac to log into the EC2 instance and it was working fine:
ssh -i "key.pem" centos@10.193.80.253
I have started getting issues after I tried configuring ssh for git in the EC2 which introduced following changes:
Added config file in ~/.ssh with the following content
Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa
I am not sure if these changes are causing any issues.
Assuming you are using github I suggest making that host specific.
ie cat ~/.ssh/config
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
If you are still having issues after this change you can debug your EC2 issue with ssh -vvv -i "key.pem" centos@10.193.80.253
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.