ssh fails; wording of the error is the clue.
Refused = nothing listening on that port. Closed = something listened, then killed the handshake.
systemctl status sshd && ss -tlnp | grep :22tail -20 /var/log/auth.log # MaxStartups? AllowUsers?nc -vz host 22Keep an out-of-band console path so SSH is never your only way in.
Spinning up a fresh box to reproduce or escape this error?
Managed cloud hostingNinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.
Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog