SSH error messages, what each one means
What common SSH error messages mean, grouped by when they appear, before connect, the host key check, authentication, and after login or a drop.
When an SSH connection fails, the client or the server prints a specific line. This page lists the common messages, in the order they occur, and links to the article that explains each one.
Before the connection starts
These appear before you log in, often before any host key check.
- "line 14: Bad configuration option: usekeychain" and "terminating, 1 bad configuration options". ssh could not read its own configuration file and stopped before connecting. See SSH "Bad configuration option" in ~/.ssh/config or sshd_config.
- "ssh: Could not resolve hostname ...: Name or service not known", or "Temporary failure in name resolution". The name never became an IP address, so nothing was sent. See ssh "Could not resolve hostname": Name or service not known.
- "Connection refused" (Windows code 10061). Nothing is listening on that port, or the port number is wrong. See Connection abort, reset and timed-out errors in SSH and Telnet clients.
- "Connection timed out" (10060) when you first connect. Packets never got a reply. Check the host name, the port, and firewalls in the path. The same text mid-session is a drop, listed later on this page. See Connection abort, reset and timed-out errors in SSH and Telnet clients.
- "Host not found" (11001), "Network is unreachable" (10051), "No route to host" (10065), or "Network is down" (10050). The name could not be resolved, or the local system has no route. See Connection abort, reset and timed-out errors in SSH and Telnet clients.
- "kex_exchange_identification: Connection closed by remote host", "Connection closed by ... port 22", or "kex_exchange_identification: read: Connection reset by peer". The TCP connection opened, then the host closed or reset it before sending its SSH identification line. A busy server,
MaxStartups, orPerSourcePenaltiescan do this. See SSH banner exchange errors, "Connection closed" and "timed out during banner exchange". - "Connection timed out during banner exchange". The TCP connection opened, but the identification line did not arrive in time. See SSH banner exchange errors, "Connection closed" and "timed out during banner exchange".
- "Invalid SSH identification string" or "No SSH identification string received". The other end answered, but not with an SSH identification line. The port may belong to another service. See SSH banner exchange errors, "Connection closed" and "timed out during banner exchange".
- "Unable to negotiate ... no matching key exchange method found" or "no matching host key type found", and the same form for "no matching cipher" or "no matching MAC". The client and server share no algorithm in one of the lists they exchange at the start. "Their offer" is what the server sent. See SSH "no matching key exchange method" and "no matching host key type" errors.
- "WARNING: connection is not using a post-quantum key exchange algorithm". A warning from OpenSSH 10.1 and later, not a failure: the server offered no post-quantum key exchange, and the login goes on. See SSH "connection is not using a post-quantum key exchange algorithm".
- "ControlPath too long", "too long for Unix domain socket", "Session open refused by peer" or "ControlSocket ... already exists, disabling multiplexing". These come from connection sharing (ControlMaster). See SSH "ControlPath too long" and other connection-sharing errors.
The host key
- "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED" and "Host key verification failed." The host offered a key that does not match the one saved for that name. The client stops before sending a password. See Read the SSH warning "REMOTE HOST IDENTIFICATION HAS CHANGED".
- "POSSIBLE DNS SPOOFING DETECTED". The client also checks a key saved for the host's IP address, and that check failed in a way that can mean the address and the key both changed, or that DNS is being spoofed. See Read the SSH warning "REMOTE HOST IDENTIFICATION HAS CHANGED".
- "client_global_hostkeys_private_confirm: server gave bad signature for RSA key 0". A warning after login, not a failure: the client could not save the server's extra host keys. See SSH "server gave bad signature for RSA key 0" (client_global_hostkeys_private_confirm).
- "Host key verification failed." only when going through a jump host, often after "No ED25519 host key is known for ... and you have requested strict checking." Your computer checks both the jump host's and the target's key; the line above the failure names which one. See Host key verification failed through a jump host (ProxyJump).
Authentication
- "WARNING: UNPROTECTED PRIVATE KEY FILE!" and
Load key "...": bad permissions. Your private key file can be read by other accounts, so the client ignores it. See SSH "WARNING: UNPROTECTED PRIVATE KEY FILE!" and bad permissions. Load key "...": invalid formatorLoad key "...": error in libcrypto. The client could not read the file as a private key. See SSH Load key "invalid format" and "error in libcrypto".- "sign_and_send_pubkey: no mutual signature supported". The key loaded, but client and server share no signature algorithm for it, usually an RSA key and an old server. See SSH "sign_and_send_pubkey: no mutual signature supported".
- "sign_and_send_pubkey: signing failed ... agent refused operation". The agent holds the key but would not sign with it, for example a key added with
ssh-add -cand no askpass program, or a locked agent. See SSH "agent refused operation": signing failed and could not add identity. - "Too many authentication failures", often as
Received disconnect from ... Too many authentication failures. The server ended this connection because it had too many failed attempts, often because the client offered many keys. The count starts again on the next connection. The account is not locked. See SSH "Too many authentication failures". - "Server refused our key" (PuTTY). PuTTY offered a public key and the server would not accept it for that account, before any passphrase prompt. See PuTTY "Server refused our key": why and how to fix it.
- "No supported authentication methods available (server sent: publickey)" (PuTTY). PuTTY has no login method left that the server allows; with
publickeyonly, a password will never work. See PuTTY "No supported authentication methods available (server sent: publickey)".
After login, or when the session ends
Some of these are warnings after a successful login. Others are the last line of a session that has already dropped.
- "Warning: remote port forwarding failed for listen port 8080", or the same line starting with
Error:whenExitOnForwardFailureis set. The login worked, but the server would not listen on the port you asked for withssh -R. See SSH "remote port forwarding failed for listen port": why ssh -R is refused. - "channel 3: open failed: connect failed: Connection refused" or "open failed: administratively prohibited" (any channel number), each time a program uses a forwarded port. The server could not, or would not, connect to the target of your
ssh -Lor-Dforward. See SSH "channel 3: open failed: connect failed: Connection refused" with port forwarding.
- "PTY allocation request failed on channel 0". Login worked, but the host refused a pseudo-terminal. See SSH "PTY allocation request failed on channel 0".
- "This account is currently not available." Authentication worked, then the account's login shell (
nologin) printed this and exited, so the session closed. See SSH "This account is currently not available" (nologin shell). - "setlocale: LC_ALL: cannot change locale", or a similar locale warning. The login worked. The shell was asked to use a locale the host does not have. See Locale warning after SSH login, "setlocale: LC_ALL: cannot change locale".
- "Received message too long" and "Ensure the remote shell produces no output for non-interactive sessions." SSH login works, but SFTP fails because the remote shell printed text before the SFTP server spoke. See SFTP "Received message too long".
- "Connection closed" right after an SFTP login, with "bad ownership or modes for chroot directory" in the server log. The chroot path is not root-owned or is writable by others. See SFTP chroot: bad ownership or modes for chroot directory.
- "Could not open a connection to your authentication agent", "Error connecting to agent: Permission denied", or "Error connecting to agent: No such file or directory". These appear after
sudoorsu, when the new environment cannot reach the SSH agent socket. See SSH agent not available after sudo or su. On your own computer, with nosudoinvolved, they usually mean no agent is running in that shell; see ssh-add "Could not open a connection to your authentication agent": start the agent. - "client_loop: send disconnect: Broken pipe". The client tried to close the session after the TCP connection was already gone. See SSH "client_loop: send disconnect: Broken pipe".
- "Timeout, server ... not responding." The client's server-alive check got no answer and gave up. See SSH "client_loop: send disconnect: Broken pipe" and SSH keep-alives and idle timeouts.
- "Corrupted MAC on input" and "message authentication code incorrect". A packet failed its integrity check after login, from a buggy MAC algorithm on one side or data damaged in transit. See SSH "Corrupted MAC on input" and "message authentication code incorrect".
- "Software caused connection abort" (10053). Software on your device closed a connection that had been working, often after an idle gap, a network change, or a sleep. See Connection abort, reset and timed-out errors in SSH and Telnet clients.
- "Connection reset by peer" (10054) mid-session. The remote host, or something in front of it, forcibly closed the connection. See Connection abort, reset and timed-out errors in SSH and Telnet clients.
If a session dropped and you want the cause rather than the exact SSH text, start at Why did my session disconnect?.
Related
- SSH: how it works
- SSH keep-alives and idle timeouts
- Why did my session disconnect?
- SSH problems
- SFTP chroot: bad ownership or modes for chroot directory
- SSH "Corrupted MAC on input" and "message authentication code incorrect"
- SSH "server gave bad signature for RSA key 0" (client_global_hostkeys_private_confirm)
- SSH "connection is not using a post-quantum key exchange algorithm"
- SSH "Bad configuration option" in ~/.ssh/config or sshd_config
- SSH "agent refused operation": signing failed and could not add identity
- SSH "ControlPath too long" and other connection-sharing errors
- ssh-add "Could not open a connection to your authentication agent": start the agent
- PuTTY "Server refused our key": why and how to fix it
- PuTTY "No supported authentication methods available (server sent: publickey)"
- SSH "remote port forwarding failed for listen port": why ssh -R is refused
- SSH "channel 3: open failed: connect failed: Connection refused" with port forwarding
- SSH "Permission denied, please try again." with the right password
- SSH "X11 forwarding request failed on channel 0" and "cannot open display" with ssh -X