Error "Connection reset by peer" with ssh

0

I am currently experiencing an issue with SSH connections to my EC2 instance. Whenever I attempt to connect using SSH, I receive the following error message: "kex_exchange_identification: read: Connection reset by peer."

I have verified that my SSH key pair is correctly configured and the security groups allow inbound SSH traffic on port 22. However, I am still unable to establish a successful SSH connection.

I would greatly appreciate any guidance or suggestions to regain SSH access to my EC2 instances. Thanks in advance!

asked a year ago2409 views
1 Answer
0

Is it being rejected by the TCPWrapper?
You may need to review the settings in "/etc/hosts.allow" and "/etc/hosts.deny" of your EC2 instance.
In particular, you should check the file "/etc/hosts.deny".
If your IP address is listed in this file, your connection will be denied.

If SSM Agent is installed on EC2, try using Session Manager instead of SSH to connect.
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html

profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions