Skip to content

connectors.ssh: encrypted ssh_config IdentityFile prompts for passphrase even when it's already unlocked in ssh-agent #2066

Open

Description

@kevinschweikert

Describe the bug

Since 3.11, if a host's ~/.ssh/config has an IdentityFile pointing at an encrypted private key, pyinfra now loads and decrypts that key file itself and if no passphrase is known, it blocks waiting for one via a terminal prompt.

The problem is it does this even when ssh-agent (or a Keychain-backed agent) already has the key unlocked and ready to use. Now pyinfra prompts for the passphrase regardless, which breaks any workflow built around ssh-add/agent-based key management (e.g. ssh-add --apple-load-keychain on macOS). You get an unexpected blocking prompt on every run even though the connection would succeed instantly via the agent.

To Reproduce

  • Have an encrypted private key referenced via IdentityFile in ~/.ssh/config for some host.
  • Load that key into ssh-agent (or macOS Keychain) so agent auth would succeed without a passphrase.
  • Run any pyinfra command against that host with no ssh_key/ssh_key_password set in the inventory:
    hosts = [("my-host.example.com", {})]
    pyinfra inventory.py exec -- echo hi

Expected behavior

before trying to load and decrypt the IdentityFile itself, check whether the agent already has a matching key loaded and prefer that.

Meta

> pyinfra --support

    If you are having issues with pyinfra or wish to make feature requests, please
    check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
    When adding an issue, be sure to include the following:

    System: Darwin
      Platform: macOS-15.7.3-arm64-arm-64bit-Mach-O
      Release: 24.6.0
      Machine: arm64
    pyinfra: v3.11.0
      cyclopts: v4.25.3
      distro: v1.9.0
      gevent: v26.9.0
      jinja2: v3.1.6
      packaging: v26.3
      paramiko: v4.0.0
      pydantic: v2.14.1
      python-dateutil: v2.9.0.post0
      rich: v15.0.0
      typeguard: v4.6.0
      types-paramiko: v4.0.0.20260518
      typing-extensions: v4.16.0
    Executable: /Users/kevinschweikert/projects/imen/it-automation/.venv/bin/pyinfra
    Python: 3.14.7 (CPython, Clang 22.1.3 )

Installed via uv

Activity

  1. added
    connectors
    on Nov 9, 2026
  2. kevinschweikert commented on Nov 9, 2026

    @kevinschweikert
    ContributorAuthor

    I just want to add that it's even more unergonomic than i feared. The password prompt will be made for every host in the inventory and if a reboot operation is in the deployment, the password prompt needs to be inputted again

  3. cl-parsons commented on Nov 17, 2026

    @cl-parsons

    I have the same problem, and it's throwing an ugly exception before asking me for the new private key.
    If I enter the password for my key it works well.

    OS: ArtixLinux
    pid1: OpenRC
    Terminal: foot
    WM: sway (wayland)

        System: Linux
          Platform: Linux-6.18.62-1-lts-x86_64-with-glibc2.44
          Release: 6.18.62-1-lts
          Machine: x86_64
        pyinfra: v3.11.1
          cyclopts: v4.25.3
          distro: v1.9.0
          gevent: v26.9.0
          jinja2: v3.1.6
          packaging: v26.3
          paramiko: v5.1.0
          pydantic: v2.14.3
          python-dateutil: v2.9.0.post0
          rich: v15.0.0
          typeguard: v4.6.0
          types-paramiko: v5.1.0.20261030
          typing-extensions: v4.16.0
        Executable: /home/scramble/.venv/pyinfra/bin/pyinfra
        Python: 3.14.10 (CPython, GCC 16.2.1 20260810)
    

    inventory

    myvm = (
    	["myvm",], 
    	{
    		"ssh_user": "root",
    	}
    )
    

    .ssh/config

    Host myvm
        Hostname 127.0.0.1
        IdentityFile ~/.ssh/id_ed25519-xxx
    

    ssh-add

    $ ssh-add -l
    256 SHA256:GgFz8P/bayQCaxOb283S8rYDLX3lKDn6BUVZesk0lpY scramble@localhost (ED25519)
    

    Output: (I press return on password prompt because the key is already loaded

    $ pyinfra inventoryA.py -vvv --debug exec -- echo "hello world" 
    --> Loading config...
    --> Loading inventory...
        [pyinfra_cli.inventory] Creating fake inventory...
        [pyinfra_cli.inventory] Checking possible group_data at: /mnt/storage/src
    
    --> Connecting to hosts...
        [pyinfra.connectors.ssh] Connecting to: myvm ({'allow_agent': True, 'look_for_keys': True, '_pyinfra_ssh_forward_agent': False, '_pyinfra_ssh_config_file': None, '_pyinfra_ssh_known_hosts_file': None, '_pyinfra_ssh_strict_host_key_checking': 'accept-new', '_pyinfra_ssh_paramiko_connect_kwargs': None, 'username': 'root', 'timeout': 10})
        [pyinfra.connectors.sshuserclient.client] Loading SSH config: None
    Traceback (most recent call last):
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/gevent/threadpool.py", line 192, in __run_task
        thread_result.set(func(*args, **kwargs))
                          ~~~~^^^^^^^^^^^^^^^^^
    OSError: [Errno 16] Device or resource busy
    2026-11-17T20:50:34Z (<ThreadPoolWorker at 0x7f28fda47bc0 thread_ident=0x7f28fda266c0 threadpool-hub=<Hub at 0x7f29015838d0 thread_ident=0x7f29019feb80>>, <built-in function gethostbyaddr>) failed with OSError
    
    Enter password for private key: /home/scramble/.ssh/id_ed25519-xxx: 
    Traceback (most recent call last):
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh_util.py", line 75, in _load_private_key_file
        return key_cls.from_private_key_file(
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
            filename=filename,
            ^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 467, in from_private_key_file
        key = cls(filename=filename, password=password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py", line 64, in __init__
        self._from_private_key_file(filename, password)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py", line 196, in _from_private_key_file
        data = self._read_private_key_file("RSA", filename, password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 568, in _read_private_key_file
        data = self._read_private_key(tag, f, password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 599, in _read_private_key
        data = self._read_private_key_openssh(lines[start:end], password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 705, in _read_private_key_openssh
        raise PasswordRequiredException(
            "private key file is encrypted"
        )
    paramiko.ssh_exception.PasswordRequiredException: private key file is encrypted
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "src/gevent/greenlet.py", line 912, in gevent._gevent_cgreenlet.Greenlet.run
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/api/host.py", line 391, in connect
        self.connector.connect()
        ~~~~~~~~~~~~~~~~~~~~~~^^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh.py", line 231, in connect
        return self._connect()
               ~~~~~~~~~~~~~^^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh.py", line 261, in _connect
        self.client.connect(hostname, **kwargs)
        ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/sshuserclient/client.py", line 400, in connect
        ) = self.parse_config(
            ~~~~~~~~~~~~~~~~~^
            hostname,
            ^^^^^^^^^
        ...<2 lines>...
            strict_host_key_checking=_pyinfra_ssh_strict_host_key_checking,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/sshuserclient/client.py", line 520, in parse_config
        _attach_identity_with_certificate(cfg, host_config)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/sshuserclient/client.py", line 144, in _attach_identity_with_certificate
        cfg["pkey"] = load_key_with_certificate(
                      ~~~~~~~~~~~~~~~~~~~~~~~~~^
            key_filename=identity_file,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
            certificate_filename=certificate_filename,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh_util.py", line 149, in load_key_with_certificate
        key = _load_private_key_file(
            candidate,
        ...<2 lines>...
            allow_prompt=allow_prompt,
        )
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh_util.py", line 98, in _load_private_key_file
        return key_cls.from_private_key_file(
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
            filename=filename,
            ^^^^^^^^^^^^^^^^^^
            password=key_password,
            ^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 467, in from_private_key_file
        key = cls(filename=filename, password=password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py", line 64, in __init__
        self._from_private_key_file(filename, password)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py", line 196, in _from_private_key_file
        data = self._read_private_key_file("RSA", filename, password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 568, in _read_private_key_file
        data = self._read_private_key(tag, f, password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 599, in _read_private_key
        data = self._read_private_key_openssh(lines[start:end], password)
      File "/home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py", line 713, in _read_private_key_openssh
        key_iv = bcrypt.kdf(
            b(password),
        ...<5 lines>...
            ignore_few_rounds=True,
        )
    ValueError: password and salt must not be empty
    2026-11-17T20:50:37Z <Greenlet at 0x7f28fda782c0: <bound method Host.connect of Host(myvm)>> failed with ValueError
    
    
    --> Disconnecting from hosts...
    --> An internal exception occurred:
    
    ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh_util.py:75 in _lo │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:467 in from_private_key │
    │                                                                                                  │
    │    464 │   │   │   encrypted, and ``password`` is ``None``                                       │
    │    465 │   │   :raises: `.SSHException` -- if the key file is invalid                            │
    │    466 │   │   """                                                                               │
    │ ❱  467 │   │   key = cls(filename=filename, password=password)                                   │
    │    468 │   │   return key                                                                        │
    │    469 │                                                                                         │
    │    470 │   @classmethod                                                                          │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py:64 in __init__        │
    │                                                                                                  │
    │    61 │   │   │   self._from_private_key(file_obj, password)                                     │
    │    62 │   │   │   return                                                                         │
    │    63 │   │   if filename is not None:                                                           │
    │ ❱  64 │   │   │   self._from_private_key_file(filename, password)                                │
    │    65 │   │   │   return                                                                         │
    │    66 │   │   if (msg is None) and (data is not None):                                           │
    │    67 │   │   │   msg = Message(data)                                                            │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py:196 in _from_private_ │
    │                                                                                                  │
    │   193 │   # ...internals...                                                                      │
    │   194 │                                                                                          │
    │   195 │   def _from_private_key_file(self, filename, password):                                  │
    │ ❱ 196 │   │   data = self._read_private_key_file("RSA", filename, password)                      │
    │   197 │   │   self._decode_key(data)                                                             │
    │   198 │                                                                                          │
    │   199 │   def _from_private_key(self, file_obj, password):                                       │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:568 in _read_private_ke │
    │                                                                                                  │
    │    565 │   │   :raises: `.SSHException` -- if the key file is invalid.                           │
    │    566 │   │   """                                                                               │
    │    567 │   │   with open(filename, "r") as f:                                                    │
    │ ❱  568 │   │   │   data = self._read_private_key(tag, f, password)                               │
    │    569 │   │   return data                                                                       │
    │    570 │                                                                                         │
    │    571 │   def _read_private_key(self, tag, f, password=None):                                   │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:599 in _read_private_ke │
    │                                                                                                  │
    │    596 │   │   │   data = self._read_private_key_pem(lines, end, password)                       │
    │    597 │   │   │   pkformat = self._PRIVATE_KEY_FORMAT_ORIGINAL                                  │
    │    598 │   │   elif keytype == "OPENSSH":                                                        │
    │ ❱  599 │   │   │   data = self._read_private_key_openssh(lines[start:end], password)             │
    │    600 │   │   │   pkformat = self._PRIVATE_KEY_FORMAT_OPENSSH                                   │
    │    601 │   │   else:                                                                             │
    │    602 │   │   │   raise SSHException(                                                           │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:705 in _read_private_ke │
    │                                                                                                  │
    │    702 │   │   │   # If no password was passed in, raise an exception pointing                   │
    │    703 │   │   │   # out that we need one                                                        │
    │    704 │   │   │   if password is None:                                                          │
    │ ❱  705 │   │   │   │   raise PasswordRequiredException(                                          │
    │    706 │   │   │   │   │   "private key file is encrypted"                                       │
    │    707 │   │   │   │   )                                                                         │
    │    708                                                                                           │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
    PasswordRequiredException: private key file is encrypted
    
    During handling of the above exception, another exception occurred:
    
    ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra_cli/cli.py:334 in cli            │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra_cli/cli.py:522 in _main          │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/api/connect.py:37 in connect_all │
    │                                                                                                  │
    │ in gevent._gevent_cgreenlet.Greenlet.get:809                                                     │
    │                                                                                                  │
    │ in gevent._gevent_cgreenlet.Greenlet._raise_exception:373                                        │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/gevent/_compat.py:88 in reraise          │
    │                                                                                                  │
    │    85                                                                                            │
    │    86 def reraise(t, value, tb=None): # pylint:disable=unused-argument                           │
    │    87 │   if value.__traceback__ is not tb:                                                      │
    │ ❱  88 │   │   raise value.with_traceback(tb)                                                     │
    │    89 │   raise value                                                                            │
    │    90 def exc_clear():                                                                           │
    │    91 │   pass                                                                                   │
    │                                                                                                  │
    │ in gevent._gevent_cgreenlet.Greenlet.run:912                                                     │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/api/host.py:391 in connect       │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh.py:231 in connect │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh.py:261 in _connec │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/sshuserclient/client. │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/sshuserclient/client. │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/sshuserclient/client. │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh_util.py:149 in lo │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/pyinfra/connectors/ssh_util.py:98 in _lo │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:467 in from_private_key │
    │                                                                                                  │
    │    464 │   │   │   encrypted, and ``password`` is ``None``                                       │
    │    465 │   │   :raises: `.SSHException` -- if the key file is invalid                            │
    │    466 │   │   """                                                                               │
    │ ❱  467 │   │   key = cls(filename=filename, password=password)                                   │
    │    468 │   │   return key                                                                        │
    │    469 │                                                                                         │
    │    470 │   @classmethod                                                                          │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py:64 in __init__        │
    │                                                                                                  │
    │    61 │   │   │   self._from_private_key(file_obj, password)                                     │
    │    62 │   │   │   return                                                                         │
    │    63 │   │   if filename is not None:                                                           │
    │ ❱  64 │   │   │   self._from_private_key_file(filename, password)                                │
    │    65 │   │   │   return                                                                         │
    │    66 │   │   if (msg is None) and (data is not None):                                           │
    │    67 │   │   │   msg = Message(data)                                                            │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/rsakey.py:196 in _from_private_ │
    │                                                                                                  │
    │   193 │   # ...internals...                                                                      │
    │   194 │                                                                                          │
    │   195 │   def _from_private_key_file(self, filename, password):                                  │
    │ ❱ 196 │   │   data = self._read_private_key_file("RSA", filename, password)                      │
    │   197 │   │   self._decode_key(data)                                                             │
    │   198 │                                                                                          │
    │   199 │   def _from_private_key(self, file_obj, password):                                       │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:568 in _read_private_ke │
    │                                                                                                  │
    │    565 │   │   :raises: `.SSHException` -- if the key file is invalid.                           │
    │    566 │   │   """                                                                               │
    │    567 │   │   with open(filename, "r") as f:                                                    │
    │ ❱  568 │   │   │   data = self._read_private_key(tag, f, password)                               │
    │    569 │   │   return data                                                                       │
    │    570 │                                                                                         │
    │    571 │   def _read_private_key(self, tag, f, password=None):                                   │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:599 in _read_private_ke │
    │                                                                                                  │
    │    596 │   │   │   data = self._read_private_key_pem(lines, end, password)                       │
    │    597 │   │   │   pkformat = self._PRIVATE_KEY_FORMAT_ORIGINAL                                  │
    │    598 │   │   elif keytype == "OPENSSH":                                                        │
    │ ❱  599 │   │   │   data = self._read_private_key_openssh(lines[start:end], password)             │
    │    600 │   │   │   pkformat = self._PRIVATE_KEY_FORMAT_OPENSSH                                   │
    │    601 │   │   else:                                                                             │
    │    602 │   │   │   raise SSHException(                                                           │
    │                                                                                                  │
    │ /home/scramble/.venv/pyinfra/lib/python3.14/site-packages/paramiko/pkey.py:713 in _read_private_ke │
    │                                                                                                  │
    │    710 │   │   │   salt, rounds = self._uint32_cstruct_unpack(kdf_options, "su")                 │
    │    711 │   │   │                                                                                 │
    │    712 │   │   │   # run bcrypt kdf to derive key and iv/nonce (32 + 16 bytes)                   │
    │ ❱  713 │   │   │   key_iv = bcrypt.kdf(                                                          │
    │    714 │   │   │   │   b(password),                                                              │
    │    715 │   │   │   │   b(salt),                                                                  │
    │    716 │   │   │   │   48,                                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
    ValueError: password and salt must not be empty
        [pyinfra_cli.exceptions] password and salt must not be empty
    
  4. smilingthax commented on Nov 18, 2026

    @smilingthax
    • An IdentityFile in ssh_config makes pyinfra set cfg["key_filename"] and call load_key_with_certificate() → ssh_util._load_private_key_file(), which prompts when the key is encrypted.
      The agent is never consulted.

    • Passing the right pubkey is actually enough:

      paramiko.AgentKey is a PKey whose sign_ssh_data goes to the agent. Hand it over as pkey and _attach_identity_with_certificate() skips the load and pops key_filename, so paramiko offers exactly that key, signed by the agent.

    • Final fallback: every agent key is tried... (not good, either)
      This isn't only about the prompt. Two ways a connection does end up offering every loaded key:

      • no IdentityFile (and no ssh_key in the inventory)
      • an encrypted IdentityFile and not CLI mode — i.e. pyinfra.is_cli is False (pyinfra is used as a library): instead of prompting, the load raises, pyinfra swallows it and drops back to the agent. (There's no public way to get this behaviour in CLI mode; allow_prompt is internal.)

      In both cases paramiko offers each loaded key in turn and the server counts every rejection. A handful of keys is enough to exhaust the usual six attempts and fail a connection that ssh completes on the first try, because it offers
      only the public half of the key file.

      ssh succeeds with just 1 when it knows the (encrypted) IdentityFile, and the key is in the agent.

    (Evil) Workaround:

    _orig = client.load_key_with_certificate
    
    def load_key_with_certificate(*a, **kw):
        kw["allow_prompt"] = False              # never block
        try:
            return _orig(*a, **kw)              # plain keys/certs: unchanged
        except PyinfraError:                    # encrypted -> use the agent's copy
            pub = Path(f"{Path(kw.get('key_filename') or a[0]).expanduser()}.pub")
            if not pub.is_file():
                raise
            blob = pub.read_text().split()[1]
            for key in paramiko.Agent().get_keys():
                if key.get_base64() == blob:
                    return key                  # AgentKey is a PKey; signs via agent
            raise
    
    client.load_key_with_certificate = load_key_with_certificate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectorssecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions