Post a reply

Options
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)

Options

Topic review

Dataporter

I figured it out!

I used this
Implementing SSH host key cache (known hosts)
and was able to find the key
ssh-ed25519 255 Y9eKTIbPMgStKTOOGhtA+zTYakwJoHNNHqjEXVIHAgg

<KnownHosts>
  <KnownHost host="files.itsasecret.com:22" fingerprint="ssh-ed25519 255 Y9eKTIbPMgStKTOOGhtA+zTYakwJoHNNHqjEXVIHAgg" />
</KnownHosts>

I appreciate the documentation on this site! Sorry I didn't find this solution sooner! Dave
Dataporter

Unable to match sshkey using C# – able to connect interactively

Hello!
Thanks in advancé for your help!
I've tried everything I can think of...
I can connect interactively with WinSCP, log part:
. 2025-04-23 08:38:18.126 Remote version: SSH-2.0-AWS_SFTP_1.2
. 2025-04-23 08:38:18.126 Using SSH protocol version 2
. 2025-04-23 08:38:18.126 Have a known host key of type ssh-ed25519
. 2025-04-23 08:38:18.260 Doing ECDH key exchange with curve nistp256 and hash SHA-256
. 2025-04-23 08:38:18.441 Server also has ecdsa-sha2-nistp521 host key, but we don't know it
. 2025-04-23 08:38:18.442 Host key fingerprint is:
. 2025-04-23 08:38:18.442 ssh-ed25519 255 SHA256:Y9eKTIbPMgStKTOOGhtA+zTYakwJoHNNHqjEXVIHAgg
. 2025-04-23 08:38:18.451 Host key matches cached key
. 2025-04-23 08:38:18.452 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2025-04-23 08:38:18.452 Initialised HMAC-SHA-256 outbound MAC algorithm (in ETM mode)
. 2025-04-23 08:38:18.452 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption

C#
sshkey = "ssh-ed25519 255 SHA256:Y9eKTIbPMgStKTOOGhtA+zTYakwJoHNNHqjEXVIHAgg";

message from server:
System.ArgumentException: SSH host key fingerprint "ssh-ed25519 255 SHA256:Y9eKTIbPMgStKTOOGhtA+zTYakwJoHNNHqjEXVIHAgg" does not match pattern /((ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))( |-))?(\d+ )?(([0-9a-f]{2}(:|-)){15}[0-9a-f]{2}|[0-9a-zA-Z+/]{43}=)(;((ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))( |-))?(\d+ )?(([0-9a-f]{2}(:|-)){15}[0-9a-f]{2}|[0-9a-zA-Z+/]{43}=))*/

   at WinSCP.SessionOptions.SetSshHostKeyFingerprint(String s)
   at WinSCP.SessionOptions.set_SshHostKeyFingerprint(String value)
   at MsiAvail.Form1.DoSession() in C:\Users\dport\Documents\Visual Studio 2017\MsiAvail\MsiAvail\MsiAvail\Form1.cs:line 146

Thanks in advance, Dave