简体   繁体   中英

AWS EC2 : SSH is not working after changing the Security Group

I have AWS EC2 VPS micro instance. I changed its security group to newly created group which has all old plus new rules including ssh. But now I can't login to my instance using my existing key "ssh -i mykey.pem root@52.xx.xx.xx"

Based on the logs looks like its not liking my key anymore. I rebooted the instance also tried switching back to old security group but same error. Not sure how could I recover it back. Its running on CentOS 7.

SSH logs :

debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Trying private key: mykey.pem
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

This issue has nothing to do with security groups. Security groups can either allow or prevent access to your ssh server, but will not change the traffic otherwise. That means, any key issues you have are unrelated to this change.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM