[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ssh bug known_hosts?



I may have found a bug in openssh.

I raise it here as the ssh mailing list is actually a newsgroup that no-one seems to use.

I can ssh jeremy@client.example.com without the issue

I have created a ~/.ssh/config file with contents

Host jeremy_client
    HostName client.example.com
    User jeremy
    IdentityFile ~/.ssh/com.example.jeremy.id_rsa


when I ssh jeremy_client I get two issues:

1. The host ssh client is unrecognised so needs adding to the known_hosts file

2. The known hosts file used is /etc/ssh/known_hosts rather that ~/.ssh/known_hosts - which causes a permissions error

Is this a bug or a feature?

I can solve the immediate problem by adding a line to the config entry.

Host jeremy_client
    HostName client.example.com
    User jeremy
    IdentityFile ~/.ssh/com.example.jeremy.id_rsa
    UserKnownHostsFile ~/.ssh/known_hosts

ssh -V
OpenSSH_8.4p1 Debian-5+deb11u1, OpenSSL 1.1.1n  15 Mar 2022


--


Jeremy


Reply to: