In some integrations with SFTP, for example from NIFI, I have often encountered the following error message:

ListSFTP[id=a9f3e106-0177-1000-2137-90dcc74fc40e] Failed to perform listing on
remote host due to Could not verify 'ssh-ed25519' host key with fingerprint
'bd:7d:dc:55:d9:6f:7b:9a:06:80:8f:58:25:51:1a:87' for '' on port 22:
net.schmizz.sshj.transport.TransportException: [HOST_KEY_NOT_VERIFIABLE] Could not
verify 'ssh-ed25519' host key wiht fingeprint
'bd:7d:dc:55:d9:6f:7b:9a:06:80:8f:58:25:51:1a:87' for '' on port 22

This error is because the sftp client, in this particular case it is a LISTSFTP component of NIFI that does not add the received key to the known_hosts file, does not find in the known_hosts file, which is usually the $HOME/.ssh, the public key of the server to which it connects and which returns it, in this example case 'ed25519'.

The solution is to run:

ssh-keyscan -t ed25519

And this returns the key in ed25199: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIIZGD6MfnBLF2DociL367c6f47JQqGfk5bmbfNOLqSa

Adding this line to the end of known_hosts the problem is solved because the SFTP client finds the received key in the file and in the appropriate format. There are other possible solutions such as configuring NIFI to accept other types of key digestions or ssh configuration on servers that communicate on both sides.