kex_exchange_identification 🌿 Git

kex_exchange_identification: Connection closed by remote host

The SSH connection was closed before the handshake — server overload, rate limiting, or a proxy/firewall interfering.

Seen on: Git

Meaning

Often transient (server-side load or DDoS protection) or caused by networks that intercept SSH. Retrying or using port 443 helps.

Common causes

  • Remote side rate limiting/overloaded
  • Firewall/proxy intercepting SSH
  • MaxStartups limit on a self-hosted server

⚡ Quick fix

  1. Retry after a moment
  2. Try SSH over 443
  3. Use HTTPS

Detailed fix by platform

Git

  1. ssh -vT -p 443 git@ssh.github.com

How to diagnose

  1. Repeatable — Every time or intermittent?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.