Skip to content

[BUG] - known_hosts can't be a directory #2734

Open

Description

@holgersson32644

Are you using paramiko as a client or server?

Client

What feature(s) aren't working right?

known_hosts

What version(s) of paramiko are you using?

5.1.0

What version(s) of Python are you using?

3.14.10_p1

What operating system and version are you using?

Gentoo Linux

If you're connecting as a client, which SSH server are you connecting to?

OpenSSH 10.6_p2

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

pyinfra 3.11.2

Expected/desired behavior

Hi,
with openssh you can split your known_hosts from a single file into a dir, e.g. ~/.ssh/known_hosts.d/ and have per-host files. To me, this makes management of hosts far easier (I've got around 120 hosts there).

Actual behavior

Paramiko fails with on my setup with:
Failed to load host keys from /home//.ssh/known_hosts: [Errno 2] No such file or directory: '/home//.ssh/known_hosts'

How to reproduce

No response

Anything else?

No response

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