Repository navigation
Paramiko 5 support - #487
Merged
Merged
Conversation
Paramiko's default RSA signature algorithm depends on its version: up to 4.x it is the SHA-1 based ssh-rsa, 5.0.0 raises a KeyError and 5.1.0 uses rsa-sha2-512. Paramiko 5 can no longer verify ssh-rsa signatures at all, so a server running it rejects every RSA signature we produced so far, including those from ssh-agent keys. Request rsa-sha2-512 explicitly so that the signature is the same with every paramiko version and verifiable by every server on paramiko 2.9+.
Debian bookworm ships 2.12 and the latest release is 5.1.0. None of the APIs we use changed apart from the RSA signature default, which we no longer rely on. Raise the lower bound to 2.9 as that is the first version supporting the rsa-sha2-512 signatures we send now. The locked version stays below 5 on purpose: a server on paramiko 5 rejects RSA signatures from clients not signing with SHA-2 yet.
adminapi requires paramiko 2.9 or newer now, so Ed25519Key and PublicBlob are always importable and the code paths working around their absence can never run.
v0devil
approved these changes
Nov 27, 2026
There was a problem hiding this comment.
🟡 Changes recommended
The SSH signing changes lack regression tests, and CI’s Paramiko 3.5.1 pin leaves the advertised 5.x compatibility unverified.
1 open issue
What changed in this PR
This PR prepares adminapi and serveradmin’s SSH-key authentication for Paramiko 5 while removing compatibility code for older, unsupported versions.
Changes:
- Allow Paramiko versions
>=2.9,<6. - Explicitly request RSA SHA-512 signatures for compatibility with Paramiko 5.
- Remove obsolete key-loading fallbacks and documentation.
| File | Description |
|---|---|
uv.lock |
Updates adminapi’s Paramiko dependency constraint. |
packages/serveradmin/serveradmin/apps/models.py |
Removes legacy public-key import and parsing fallbacks. |
packages/adminapi/pyproject.toml |
Raises the minimum Paramiko version and permits 5.x. |
packages/adminapi/adminapi/request.py |
Selects RSA SHA-512 signing and simplifies key imports. |
docs/source/python-api.rst |
Removes the obsolete Ed25519 version requirement note. |
Review effort: Balanced
The signing path changed to request rsa-sha2-512 explicitly, but nothing covered it. Sign with file-loaded RSA, ECDSA and Ed25519 keys and with an RSA agent key, then verify the way serveradmin does. Also assert the RSA signature algorithm: paramiko older than 5 still verifies ssh-rsa, so the round trip alone would not notice a fallback to SHA-1 that a server on paramiko 5 rejects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Allow usage of paramiko 5.x and add compatibility.