Skip to content

[FEAT] - Support for ecdsa-sk and ed25519-sk #2299

Open

Description

@crabhi

Is this feature for paramiko acting as a client or a server?

Client

What functionality does this feature request relate to?

Keys/auth

For client-side features, does this relate to a specific type of SSH server?

OpenSSH

If you're using paramiko as part of another tool, which tool/version?

Fabric, Ansible

Desired behavior

Openssh v.8.2 added support for FIDO/U2F tokens introducing [email protected] and [email protected]. See: https://www.openssh.com/txt/release-8.2

When such a key is present in the SSH agent, the client connection fails with (traceback from Ansible, but Fabric fails similarly)

Traceback (most recent call last):
  File "/home/krab/.virtualenvs/ansible/lib/python3.10/site-packages/paramiko/transport.py", line 2185, in run
    handler(m)
  File "/home/krab/.virtualenvs/ansible/lib/python3.10/site-packages/paramiko/auth_handler.py", line 394, in _parse_service_accept
    key_type, bits = self._get_key_type_and_bits(self.private_key)
  File "/home/krab/.virtualenvs/ansible/lib/python3.10/site-packages/paramiko/auth_handler.py", line 218, in _get_key_type_and_bits
    if key.public_blob:
  File "/home/krab/.virtualenvs/ansible/lib/python3.10/site-packages/paramiko/agent.py", line 476, in __getattr__
    raise AttributeError(name)
AttributeError: public_blob

It would be nice if this type of keys would be supported and Paramiko could be used instead of the OpenSSH client.

Anything else?

No response

Activity

  1. jakubman1 commented on Nov 27, 2023

    @jakubman1

    Hi,
    is there any progress on this issue?
    Thanks.

  2. strokovok commented on Jul 29, 2024

    @strokovok

    Found some dirty workaround

    You will have to load your key from agent like this:

    mykey = paramiko.Agent().get_keys()[0]

    And then do this:

    if not hasattr(mykey, "public_blob"):
        mykey.public_blob = None

    Then connect using this key:

    client.connect("a.b.c.d", 22, username="user", pkey=mykey, allow_agent=False, look_for_keys=False)

    CC @crabhi @jakubman1 @kofrezo

  3. jakubman1 commented on Jul 30, 2024

    @jakubman1

    Found some dirty workaround

    You will have to load your key from agent like this:

    mykey = paramiko.Agent().get_keys()[0]

    And then do this:

    if not hasattr(mykey, "public_blob"):
        mykey.public_blob = None

    Then connect using this key:

    client.connect("a.b.c.d", 22, username="user", pkey=mykey, allow_agent=False, look_for_keys=False)

    CC @crabhi @jakubman1 @kofrezo

    Thanks for the workaround, but I actually needed key verification, as I am using paramiko just to verify signatures.

    I managed to solve my issue by implementing ed25519-sk key verification myself, as that is the only type of -sk key I need to verify.

    If anyone is interested in the ed25519-sk key verification, here is my implementation: https://gist.github.com/jakubman1/ea54327166e43bafdbbd4d15a514f848

  4. liulk commented on Jan 30, 2026

    @liulk

    This one weird trick worked for me:

    import paramiko
    paramiko.agent.AgentKey.public_blob = None

    When connecting, use agent as usual. Touch works as an agent normally would. Tested with a [email protected] on YubiKey 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions