By anthony
$ ssh do
Connection closed by 134.199.185.111 port 22
[ettinger@wiley]:➜ ~
$ ssh do
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-90-generic x86_64)
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!
Hi there,
As we discussed on Discord, I think that this is very likely SSH MaxStartups throttling, not a broken Droplet. You mentioned that your new Droplet us getting hit by a lot of SSH bot traffic, so I think that sshd will start randomly dropping connections during key exchange when too many unauthenticated connections are in progress. That’s why retrying a few times eventually works.
You can confirm this by checking /var/log/auth.log for messages about dropped connections during startup.
Quick fix is to raise the limit in /etc/ssh/sshd_config, for example:
MaxStartups 30:30:100
Then restart sshd.
A more effective long term fix is to move SSH off port 22, which stops most bot traffic entirely. After that, the random resets usually disappear.
Heya, @anthonyaxolotl
One additional thing worth checking, especially on a brand-new Droplet, is whether sshd is dropping connections due to unauthenticated connection throttling, rather than a networking or provisioning issue. This can happen very early in the SSH handshake and can look like random connection resets.
If the Droplet is receiving a lot of automated SSH scans (very common on new public IPv4 addresses), sshd may start rejecting or closing connections once too many unauthenticated sessions are in progress. When that happens, retrying a few times often works, which matches the behaviour you’re seeing.
You can confirm whether this is happening by checking /var/log/auth.log for messages indicating dropped connections during startup or key exchange.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.