Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Host key offered

I have a number programs working using SFTP in WinSCP, but have a question. I am using a private/public key option (key given to me by the administrator) to connect. Now I am trying to go about adding the host key as well. Currently, I am just using "host-key=*", but what we'd like to do is have a script that reads the log after the first time SFTP is used to grab the host key, stuff it in a file, and have that utilized by all our WinSCP scripts. In the WinSCP logs, at one point it will read

2020-01-15 10:36:13.402 Host key fingerprint is:

2020-01-15 10:36:13.402 ssh-ed25519 256

This is not EXACTLY the key offered, but you get the idea. I tried copying the key directly from the log and using it as the host key, but could not get it to work after several different variations. I finally figured out that what WinSCP was looking for as the key was the first line and third line combined:

"ssh-ed25519 256 814C/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxx/r/84DA="

as further down below it showed "host key offered" as the line above - notably minus the second line that shows when I had "host key=*"

Is that correct? Is there a reason for the log showing "host key offered" and it having that second line in there when I use the wild card as opposed to inputting an actual host key?