/errors/ssh-protocol/no-matching-cipher-found
Unable to negotiate: no matching cipher found. Their offer: aes128-cbc,3des-cbc
- tool
- SSH protocol
- exit code
- 255
- versions
- OpenSSH 7.x+ client, OpenSSH 10.x
- os
- linux, macos, windows
no matching cipher found means the SSH client and the server have no symmetric cipher in common, so they cannot encrypt the session. Their offer: lists the server's ciphers; when it shows only aes128-cbc, aes256-cbc or 3des-cbc, the server is old: current OpenSSH clients offer only CTR, GCM and ChaCha20-Poly1305 ciphers by default, although they still support the CBC ones. Upgrade the server; for a device you cannot upgrade, enable one of the offered ciphers for that host only with Ciphers +CIPHER.
Reproduce it
A test server (Python paramiko on 127.0.0.1) restricted to CBC ciphers, and a current OpenSSH client:
ssh-keygen -q -t ed25519 -N "" -f hostkey
cat > legacy_cipher.py <<'EOF'
import socket, paramiko
key = paramiko.Ed25519Key(filename="hostkey")
srv = socket.socket(); srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind(("127.0.0.1", 4926)); srv.listen(1); srv.settimeout(30)
conn, _ = srv.accept()
t = paramiko.Transport(conn)
t._preferred_ciphers = ("aes128-cbc", "3des-cbc")
t.add_server_key(key)
try:
t.start_server(server=paramiko.ServerInterface())
except Exception:
pass
t.close()
EOF
uv run -q --no-project --python 3.13 --with paramiko==4.0.0 python legacy_cipher.py 2>/dev/null &
sleep 5
ssh -p 4926 -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null 127.0.0.1 true
echo "ssh exit code: $?"
waitOutput
Unable to negotiate with 127.0.0.1 port 4926: no matching cipher found. Their offer: aes128-cbc,3des-cbc ssh exit code: 255
Enable the cipher for one host
Host old-switch
HostName 192.0.2.1
Ciphers +aes128-cbcThe + appends to the default list instead of replacing it, so other hosts keep the modern ciphers. Check what the client will offer without connecting:
ssh -T -G -o Ciphers=+aes128-cbc old-switch | grep -i '^ciphers' | tr ',' '\n' | grep -x 'aes128-cbc'Output
aes128-cbc
ssh -Q cipher lists every cipher the client binary supports, including the CBC ones that are off by default. If the cipher from Their offer is missing from that list (old Blowfish, CAST or arcfour ciphers were removed from OpenSSH), no client option can enable it, and only a server upgrade or an older client helps.
The same negotiation fails on the other algorithm lists with no matching key exchange method found (KexAlgorithms), no matching MAC found (MACs) and no matching host key type found (HostKeyAlgorithms).