Report this

What is the reason for this report?

How to fix kex_exchange_identification: read: Connection reset

Posted on June 17, 2025

At first I thought Ansible was screwing up my ssh, but now after manually sshing and configuring my server, I find that I am still running into this SSH error. Why is it happening and what can I do to fix it?

I’m running AlmaLinux 9.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya, @elibroftw

You’re likely experiencing the error due to IP blocking (by firewalld or Fail2Ban), resource limits, or configuration errors.

Check if your IP is banned using fail2ban-client status sshd, and unban it if needed. Look at journalctl -xeu sshd for SSH server errors.

Also, test your SSH configuration with sshd -t. If the system is low on memory, it might drop connections—check free -m. Use ssh -vvv user@host for detailed client output.

Regards

Heya,

This seems like a firewall issue. Make sure you have enabled access for your the Ansible user and you are using SSH keys rather than a password.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.