Bug 476081

Summary: ip wildcard in known_hosts not functional
Product: [Frameworks and Libraries] kio-extras Reporter: Jiri Prchal <jiri.prchal>
Component: SFTPAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: voidpointertonull+bugskdeorg
Priority: NOR    
Version First Reported In: 21.12.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jiri Prchal 2023-10-25 11:38:25 UTC
ssh / sftp could have wildcards in file known_hosts for bunch of servers with same key, aka:
[10.*.*.*,172.22.*.*,!172.22.16.1]:1022 ssh-ed25519
But when I connect from krusader to such a server, a new key must be accepted and is added to the file:
[172.22.20.24]:1022 ssh-ed25519
Also shouldn't it use known_hosts2 as ssh uses?
Comment 1 Pedro V 2024-01-24 01:07:09 UTC
It's quite likely an upstream shortcoming as the SFTP KIO slave uses libssh which seems to neglect a lot of "convenience" features.
For example what you want to achieve here could be also done with HostKeyAlias, but that isn't supported either.

Apparently it doesn't use known_hosts2 by default, but surprisingly it supports the UserKnownHostsFile option, so you can request that to be also used in your SSH config file.