sshd "signature algorithm not in PubkeyAcceptedAlgorithms": Key Refused
Published
A client offered a public key whose signature algorithm is not matched by the server's PubkeyAcceptedAlgorithms list, so sshd abandoned that key offer before checking anything else about it.
What it looks like
Nov 15 03:51:11 web1 sshd-session[48211]: userauth_pubkey: signature algorithm ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
- 1Time — When it was logged; this format has no year or time zone
- 2Host — The server’s host name
- 3Program — sshd-session, one process per connection, and its process ID: a connection’s lines share it
- 4[preauth] — Logged before the user authenticated
Example lines as /var/log/auth.log shows them (/var/log/secure on RHEL and Fedora):
Nov 15 03:51:11 web1 sshd-session[48211]: userauth_pubkey: signature algorithm ssh-rsa not in PubkeyAcceptedAlgorithms [preauth] Nov 15 03:51:11 web1 sshd-session[48211]: userauth_pubkey: signature algorithm ssh-dss not in PubkeyAcceptedAlgorithms [preauth] Nov 15 04:02:37 web1 sshd-session[48344]: userauth_pubkey: signature algorithm [email protected] not in PubkeyAcceptedAlgorithms [preauth]
On our own server, the 30 days to 23 November 2026
signature algorithm … not in PubkeyAcceptedAlgorithms
112
lines · about 3.7 a day
Last seen 16 November 2026
LogTriage's production API server (Hetzner, Germany): port 22 open to the internet, key-only since 6 October 2026 (password and keyboard-interactive authentication off); nginx in front of the API on ports 80 and 443. Counted weekly from the sshd journal; no address ever leaves the server. More in the monthly attack report; which free blocklists already list these attackers is measured in the IP blocklist report, and you can check the addresses in your own log.
Where the line comes from
Format strings as written in the source of OpenSSH 10.2p1 — the versions this server runs. Each links to the exact line.
-
signature algorithm %s not in PubkeyAcceptedAlgorithmsmessage · auth2-pubkey.c:165 (OpenSSH) -
userauth_pubkey(struct ssh *ssh, const char *method)function name, logged as the prefix · auth2-pubkey.c:92 (OpenSSH)
What it means
sshd writes this line from a single check inside userauth_pubkey() at auth2-pubkey.c:164. By that point the server has already decoded the key the client offered, confirmed the decoded key’s type matches the algorithm named in the request, and confirmed the key was not already used on this connection. The remaining test is:
if (match_pattern_list(pkalg, options.pubkey_accepted_algos, 0) != 1) {
logit_f("signature algorithm %s not in "
"PubkeyAcceptedAlgorithms", pkalg);
goto done;
}
pkalg is the signature algorithm name the client sent with the key — that is the %s you see in the line — and options.pubkey_accepted_algos is the server’s PubkeyAcceptedAlgorithms setting. If the name does not match one of the patterns in that list, sshd logs the message and jumps straight to the function’s exit, so this key offer goes no further. The userauth_pubkey: prefix is the function name, added because the message is written with logit_f; the [preauth] suffix marks the unprivileged pre-authentication phase.
sshd_config(5) describes PubkeyAcceptedAlgorithms as “the signature algorithms that will be accepted for public key authentication as a list of comma-separated patterns”, and prints the default set: the Ed25519, ECDSA, security-key and certificate forms, plus rsa-sha2-512 and rsa-sha2-256. Neither ssh-rsa nor ssh-dss appears in it, so a client that insists on those legacy names is refused on a default configuration. A local setting can also remove algorithms from the default set with a leading -, which produces the same line for algorithms that would otherwise work.
The message carries no user name and no client address. Correlation has to go through the sshd-session PID or the lines immediately around it.
Is it an attack?
| Pattern | Reading |
|---|---|
One client, an ssh-rsa or ssh-dss line, then Accepted publickey on the same PID | The client offered an old key first and fell back to one the server accepts — nothing to do |
The lines start the day you upgraded the server or edited PubkeyAcceptedAlgorithms | Configuration change; the client’s preferred algorithm is no longer in the accepted set |
| A deploy, backup or monitoring account stops connecting and leaves these lines | A stale key or an old client in a job that now fails silently |
| Certificate algorithm names refused | The CA’s signature algorithm is outside the accepted set; check the certificate-signing side too |
Bursts with no Accepted line, mixed with invalid-user and failed-password noise | Internet background scanning that also throws keys at the port |
Nothing here grants access, and the key material in a public key offer is public. Treat the line as a compatibility signal first and as scanning noise second; what raises its importance is a successful authentication on the same connection or source shortly afterwards.
How to investigate
# Every refusal in the last day (Debian/Ubuntu unit is ssh; RHEL/Fedora: -u sshd)
sudo journalctl -u ssh --since "24 hours ago" \
| grep 'not in PubkeyAcceptedAlgorithms'
# Which algorithms are being refused, and how often
# (/var/log/auth.log; on RHEL/Fedora read /var/log/secure)
sudo grep 'not in PubkeyAcceptedAlgorithms' /var/log/auth.log \
| sed -n 's/.*signature algorithm \([^ ]*\) not in.*/\1/p' \
| sort | uniq -c | sort -rn
# The whole connection, by PID: who connected, from where, and how it ended
sudo grep 'sshd-session\[48211\]' /var/log/auth.log
The PID is the only link back to an address, so pull the connection first and decide from there whether the client later authenticated. Then compare what the server accepts with what the client offers:
# What this build supports, per sshd_config(5)
ssh -Q PubkeyAcceptedAlgorithms
# Anything set locally that narrows the default set
sudo grep -ri 'PubkeyAcceptedAlgorithms\|PubkeyAuthentication' \
/etc/ssh/sshd_config /etc/ssh/sshd_config.d/ 2>/dev/null
# From the client host: watch which key and algorithm it offers
ssh -v [email protected] 2>&1 | grep -i 'offer\|publickey'
An exported auth.log can be grouped by PID and source in the browser log analyzer if you need to tie the refusals to the rest of a noisy day.
How to stop it
- Fix the client, not the server, where you can. Move the account to a key whose algorithm is in the default set, or update the client so it offers
rsa-sha2-256/rsa-sha2-512for an existing RSA key instead of the legacyssh-rsaname. - If you genuinely need an old algorithm, the manual’s syntax appends rather than replaces: a list beginning with
+adds to the default set,-removes from it and^moves entries to the head. Add the one algorithm, record why, and remove it once the client is current. - Check
PubkeyAuthenticationis where you want it; the default isyes. - Limit who may even try with
AllowUsers— by default login is allowed for all users, and theUSER@HOSTform restricts particular users to particular hosts, with CIDR matching. - Leave penalties on.
PerSourcePenaltiesis enabled by default; clients that disconnect after one or more unsuccessful authentication attempts are refused for a period (authfail, default 5s), accumulating up tomax(default 10m). - Watch the per-connection limit. If the same PID also logs maximum authentication attempts exceeded, the connection hit
MaxAuthTries, whose default is 6.
sudo sshd -t && sudo systemctl reload ssh
Validate the configuration before reloading, and keep one working session open until a new one authenticates.
Does fail2ban ban it?
fail2ban’s sshd filter does not count this line as a failure in any mode.
- normal (default)not counted
- ddosnot counted
- extranot counted
- aggressivenot counted
fail2ban 1.1.1's sshd filter on the first example line above. Test your own lines in the fail2ban regex tester →
Lines you will see next to it
- … for … from … port … ssh2… sshd authenticated the named account — the line records a completed SSH login with the method used, the user, the client address and source port, and for public keys the key type and fingerprint that was accepted.
- parse … packet sshd could not read the public-key authentication request the client sent — the packet ended before its fields were parsed, so the per-connection process logged a fatal error and dropped the client without checking any key.
- maximum authentication attempts exceeded for … from … port … ssh2 One SSH connection used up every authentication attempt sshd allows it — the MaxAuthTries limit, 6 by default — so sshd logged the account name, source address and port and tore the connection down.
- Unable to negotiate with …: …. Their offer: … The client and the server had no key exchange method, host key type, cipher or MAC in common, so sshd logged what the client offered and ended the connection before any account was named.
Detect it
Frequently Asked Questions
- Does this line mean the login failed?
- It means that one key offer ended there. The code logs the message and jumps to the function's exit label, so nothing further happens with that key on this connection. A client that holds several keys will usually go on to offer the next one, so look for an "Accepted publickey" line on the same PID before concluding the session never got in.
- Why is there no user name or client address on the line?
- The format string in auth2-pubkey.c is only "signature algorithm %s not in PubkeyAcceptedAlgorithms", and the single substitution is the algorithm name the client sent. Nothing else is interpolated, so you correlate it with the connection's other lines — the preceding "Connection from" line and any Failed or Accepted lines carry the same sshd-session PID.
- Which algorithms does a stock OpenSSH server refuse?
- Anything not matched by the default list in sshd_config(5), which names ssh-ed25519, the ECDSA and security-key variants, rsa-sha2-512, rsa-sha2-256 and their certificate forms. The legacy ssh-rsa and ssh-dss names are not in that list, which is why they are the two you see most. The manual notes the available algorithms "may also be obtained using ssh -Q PubkeyAcceptedAlgorithms".
- Should this message raise an alert?
- On its own, no — it records a refusal, not access, and no credential material was exposed. It is worth a ticket when it comes from a host you expect to authenticate, because a scheduled job or deploy account may be failing silently, and worth a look when the same connection also produced invalid-user or failed-password lines.
Run your own auth.log through it
Paste or drop /var/log/auth.log (or journalctl -u ssh output) into the free browser analyzer: brute force, password spraying, a successful login after failures and invalid-user sweeps are flagged with the evidence lines. Nothing is uploaded.
Investigating something right now? LogTriage checks every address in the file against threat intelligence and writes the incident report: 10 analyses a month free. The incident pack adds the in-depth AI analysis and files up to 100 MB: 25 analyses for $19, one payment, no subscription. Pricing
How this page was made. The official definitions, field names and examples on it are copied by script from the sources it links and re-checked against them on every build. The counts come from the logs of our own internet-facing server, refreshed weekly. The investigation advice was drafted with AI from those sources and passed a separate review before publishing. What is checked, and how · found a mistake? [email protected]