Skip to content

Paramiko 5 support - #487

Merged
kofrezo merged 4 commits into
mainfrom
paramiko-5-support
Nov 27, 2026
Merged

kofrezo merged 4 commits into
mainfrom
paramiko-5-support

Conversation

@kofrezo

@kofrezo kofrezo commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Allow usage of paramiko 5.x and add compatibility.

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.
@kofrezo kofrezo self-assigned this Nov 27, 2026
@kofrezo kofrezo added dependencies Pull requests that update a dependency file ai Code fully or partially AI generated. labels Nov 27, 2026
@kofrezo
kofrezo requested a review from v0devil November 27, 2026 07:58
@v0devil
v0devil requested a balanced review from Copilot November 27, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread packages/adminapi/adminapi/request.py Resolved
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.
@kofrezo
kofrezo merged commit 98ccef0 into main Nov 27, 2026
5 checks passed
@kofrezo
kofrezo deleted the paramiko-5-support branch November 27, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Code fully or partially AI generated. dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants