1

I already put my IP address to the /etc/hosts.allow and checked if fail2ban banned my IP Address. I also checked if the sshd_config file's MaxStartups are too small but it isn't. When I checked,

tail -f /var/log/auth.log I can see the line Connection reset by XXX.XXX.X.XXX port 3000 [preauth].

But in my laptop(client) the connection is immediately stopped with the message kex_exchange_identification: read: Connection reset by peer.

Can somebody please help me with this? I've spent a good three hours on this…

+) ssh -vvv shows as below:

OpenSSH_8.1p1, LibreSSL 2.7.3 \
debug1: Reading configuration data /etc/ssh/ssh_config \
debug1: /etc/ssh/ssh_config line 47: Applying options for * \
debug2: resolve_canonicalize: hostname XXX.XXX.XX.XX is address \
debug2: ssh_connect_direct \
debug1: Connecting to XXX.XXX.XX.XX [XXX.XXX.XX.XX] port 22. \
debug1: Connection established. \
debug1: identity file /Users/sueyeon/.ssh/id_rsa type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_rsa-cert type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_dsa type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_dsa-cert type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_ecdsa type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_ecdsa-cert type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_ed25519 type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_ed25519-cert type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_xmss type -1 \
debug1: identity file /Users/sueyeon/.ssh/id_xmss-cert type -1 \
debug1: Local version string SSH-2.0-OpenSSH_8.1 \
kex_exchange_identification: read: Connection reset by peer 

+) Someone told me dsa keys (e.g. id_dsa) are no longer used by ssh (due to compromise of the dsa encryption scheme). Your server may receive the key and automatically close the connection.

What is the solution for this?

I'm using Ubuntu 20.04.2 and my laptop(client) is macOS Catalina 10.15.7

5
  • 1
    Create a new key, with i.e. ssh-keygen -b 4096 -t ed25519. See the OpenSSH releasenotes for deprecations
    – Panki
    Jun 25, 2021 at 6:40
  • Also, try clearing out the id_rsa and id_dsa files (backing them up somewhere first just in case of course). It's possible that the remote host is cutting you off because you're making too many bad authentication attempts before you even get to a key it'll accept.
    – Shadur
    Jun 25, 2021 at 6:54
  • @Shadur Thanks a lot for the suggestions, but neither worked for me. Do you guys have any other ideas?
    – bran
    Jun 25, 2021 at 12:09
  • If you have a way to access the server at all, log into it and configure sshd for maximum verbosity, then check its logs as well while you try to connect.
    – Shadur
    Jun 25, 2021 at 20:21
  • You probably don't even need to reconfigure sshd initially; just look at its log output where it gives a reason for the refusal
    – roaima
    Jul 3, 2021 at 9:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.