Topic "Randomly received “Host key wasn't verified!”"

Author Message
jctran
[View user's profile]

Joined: 2014-07-11
Posts: 1
Location: United States
Hi All,

Any help on this is greatly appreciated. I was asked to yesterday to start using WinSCP for it SFTP functionality. So I’m very new to this. I’m trying to download a summary text file from the server and sometimes it works and sometimes I get “Host key wasn't verified!” when trying to open the session. I’m not sure what I’m missing at the session options. Also attached is my log file. As you can see from the log that sometimes i was able to download the files with out issue.

Thanks in advance,

JCTran

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using WinSCP;
namespace WinSCPTest
{
class Program
{
static void Main(string[] args)
{
try
{
bool bDownload;
//string[] files = Directory.GetFiles(@Properties.Settings.Default.DoneFiles, "*.DONE", SearchOption.TopDirectoryOnly);
foreach (var file in Directory.GetFiles(@Properties.Settings.Default.DoneFiles, "*.DONE"))
{

bDownload = DownloadSummaryFile(@Properties.Settings.Default.SummaryLZ_TDOC + Path.GetFileNameWithoutExtension(file) + "//*Detail.txt");
if (bDownload == true)
{
File.Delete(file);
if (Directory.Exists(@Properties.Settings.Default.DoneFiles + Path.GetFileNameWithoutExtension(file)) == true)
{
Directory.Delete(@Properties.Settings.Default.DoneFiles + Path.GetFileNameWithoutExtension(file),true);
}
}
}




}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e);
// return 1;
}
}

static public bool DownloadSummaryFile(string FileName)
{
bool bDownloadSuccess = false;
try
{

// Setup session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
FtpMode = FtpMode.Passive,
HostName = @Properties.Settings.Default.HostName_Prod,
PortNumber = 22,
Timeout = TimeSpan.MaxValue,
UserName = @Properties.Settings.Default.UserName,
Password = @Properties.Settings.Default.Password,
//SshHostKeyFingerprint = "ssh-rsa 2048 ab:fc:27:49:39:93:4c:f5:0d:dc:7c:39:52:48:c1:67",

SshHostKeyFingerprint = @Properties.Settings.Default.HostKey_Prod

};

using (Session session = new Session())
{
// Connect
session.SessionLogPath = @"c:\temp\sftplog.log";
//session.Timeout = ;
session.Open(sessionOptions);

// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;

TransferOperationResult transferResult;
transferResult = session.GetFiles(FileName, @Properties.Settings.Default.SummaryDownloadedLZ, false, transferOptions);
// Throw on any error
transferResult.Check();

// Print results
foreach (TransferEventArgs transfer in transferResult.Transfers)
{
Console.WriteLine("Upload of {0} succeeded", transfer.FileName);

}
session.Dispose();
}

bDownloadSuccess = true;

}
catch (Exception ex)
{
bDownloadSuccess = false;
Console.WriteLine("Error: {0}", ex.Message);
}
return bDownloadSuccess;
}
}
}


********** log file ********
. 2014-07-11 12:34:52.939 --------------------------------------------------------------------------
. 2014-07-11 12:34:52.940 WinSCP Version 5.5.3 (Build 4214) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
. 2014-07-11 12:34:52.940 Configuration: nul
. 2014-07-11 12:34:52.940 Local account: MAST_SWDC\jtran
. 2014-07-11 12:34:52.940 Working directory: C:\Users\jtran\Documents\Visual Studio 2008\Projects\WinSCPTest\WinSCPTest\bin\Debug
. 2014-07-11 12:34:52.940 Process ID: 3192
. 2014-07-11 12:34:52.940 Command-line: "C:\Users\jtran\Documents\Visual Studio 2008\Projects\WinSCPTest\WinSCPTest\bin\Debug\winscp.exe" /xmllog="C:\Users\jtran\AppData\Local\Temp\wscp2DA4.0271D65F.tmp" /xmlgroups /nointeractiveinput /dotnet=553 /ini=nul /log="c:\temp\sftplog.log" /console /consoleinstance=_11684_3888474_157
. 2014-07-11 12:34:52.940 Time zone: Current: GMT-5, Standard: GMT-6 (Central Standard Time), DST: GMT-5 (Central Daylight Time), DST Start: 3/9/2014, DST End: 11/2/2014
. 2014-07-11 12:34:52.940 Login time: Friday, July 11, 2014 12:34:52 PM
. 2014-07-11 12:34:52.940 --------------------------------------------------------------------------
. 2014-07-11 12:34:52.940 Script: Retrospectively logging previous script records:
> 2014-07-11 12:34:52.940 Script: option batch on
< 2014-07-11 12:34:52.940 Script: batch on
> 2014-07-11 12:34:52.940 Script: option confirm off
< 2014-07-11 12:34:52.940 Script: confirm off
> 2014-07-11 12:34:52.940 Script: open -hostkey="ssh-rsa 2048 7a:56:93:e1:70:dd:ba:b3:d6:ac:23:4a:a3:ff:89:aa" -timeout=30 sftp://jctran:***@tqfts-eip4-pd.allstate.com:22
. 2014-07-11 12:34:52.940 --------------------------------------------------------------------------
. 2014-07-11 12:34:52.940 Session name: jctran@tqfts-eip4-pd.allstate.com (Ad-Hoc site)
. 2014-07-11 12:34:52.940 Host name: work.server.com (Port: 22)
. 2014-07-11 12:34:52.940 User name: jctran (Password: Yes, Key file: No)
. 2014-07-11 12:34:52.941 Tunnel: No
. 2014-07-11 12:34:52.941 Transfer Protocol: SFTP
. 2014-07-11 12:34:52.941 Ping type: -, Ping interval: 30 sec; Timeout: 30 sec
. 2014-07-11 12:34:52.941 Proxy: none
. 2014-07-11 12:34:52.941 Send buffer: 262144
. 2014-07-11 12:34:52.941 SSH protocol version: 2; Compression: No
. 2014-07-11 12:34:52.941 Bypass authentication: No
. 2014-07-11 12:34:52.941 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2014-07-11 12:34:52.941 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2014-07-11 12:34:52.941 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2014-07-11 12:34:52.941 Simple channel: Yes
. 2014-07-11 12:34:52.941 Return code variable: Autodetect; Lookup user groups: A
. 2014-07-11 12:34:52.941 Shell: default
. 2014-07-11 12:34:52.941 EOL: 0, UTF: 2
. 2014-07-11 12:34:52.941 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2014-07-11 12:34:52.941 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2014-07-11 12:34:52.941 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2014-07-11 12:34:52.941 Cache directory changes: Yes, Permanent: Yes
. 2014-07-11 12:34:52.941 DST mode: 1; Timezone offset: 0h 0m
. 2014-07-11 12:34:52.941 --------------------------------------------------------------------------
. 2014-07-11 12:34:52.941 Looking up host "work.server.com"
. 2014-07-11 12:34:53.077 Connecting to 10.195.246.237 port 22
. 2014-07-11 12:34:53.264 Server version: SSH-2.0-OpenSSH_4.3
. 2014-07-11 12:34:53.264 Using SSH protocol version 2
. 2014-07-11 12:34:53.264 We claim version: SSH-2.0-WinSCP_release_5.5.3
. 2014-07-11 12:34:53.357 Doing Diffie-Hellman group exchange
. 2014-07-11 12:34:53.527 Doing Diffie-Hellman key exchange with hash SHA-1
. 2014-07-11 12:34:53.750 Verifying host key rsa2 0x23,0xa3e4ef70d9c4426c 0bc3b50bf7e2567a 8e02d0fc29ff6b35 7c985c0bca9b0017 93dd2fbdb3924322 1de496d7e6b7df6c d3a8b3a636f0eb58 758a7f9edb3e3251 be7fbe3ab5310370 36f6e02fb2e439be b974f4e795c1d411 6dda24ce9bdfee94 63e674318e788227 3bb27ef353c2dc7a 9f82265bb4c5fa33 f99a0a9b00e6266e d3059b3d1c2a9fb4 3f9fe4fb8ba2b211 eb450f6e8f19abe0 172300782514c1a4 683b5d7d88634d4b e0fe427aafcb0b47 5c18d0d116aeb011 81228bb28893ed67 e8cdbf5758003885 2ba294641f65eaf5 922e898fb3f542c8 70cc56f507c356b3 2686691fcfba557b 4ddd8e6b29c6c42a c006b686bc722454 6aa600cc1e258335 with fingerprint ssh-rsa 2048 3d:0f:58:06:7f:3c:d4:81:31:6e:ce:d7:9b:ca:46:3a
. 2014-07-11 12:34:53.762 Host key does not match configured key ssh-rsa 2048 7a:56:93:e1:70:dd:ba:b3:d6:ac:23:4a:a3:ff:89:aa
. 2014-07-11 12:34:53.762 Asking user:
. 2014-07-11 12:34:53.762 **Continue connecting to an unknown server and add its host key to a cache?**
. 2014-07-11 12:34:53.762
. 2014-07-11 12:34:53.762 The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
. 2014-07-11 12:34:53.762
. 2014-07-11 12:34:53.762 The server's rsa2 key fingerprint is:
. 2014-07-11 12:34:53.762 ssh-rsa 2048 3d:0f:58:06:7f:3c:d4:81:31:6e:ce:d7:9b:ca:46:3a
. 2014-07-11 12:34:53.763
. 2014-07-11 12:34:53.763 If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel. ()
. 2014-07-11 12:34:53.763 Attempt to close connection due to fatal exception:
* 2014-07-11 12:34:53.763 Host key fingerprint is ssh-rsa 2048 3d:0f:58:06:7f:3c:d4:81:31:6e:ce:d7:9b:ca:46:3a.
* 2014-07-11 12:34:53.763 (Exception) Host key wasn't verified!
. 2014-07-11 12:34:53.763 Closing connection.
. 2014-07-11 12:34:53.763 Sending special code: 12
. 2014-07-11 12:34:54.276 --------------------------------------------------------------------------
. 2014-07-11 12:34:54.277 WinSCP Version 5.5.3 (Build 4214) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
. 2014-07-11 12:34:54.277 Configuration: nul
. 2014-07-11 12:34:54.277 Local account: MAST_SWDC\jtran
. 2014-07-11 12:34:54.277 Working directory: C:\Users\jtran\Documents\Visual Studio 2008\Projects\WinSCPTest\WinSCPTest\bin\Debug
. 2014-07-11 12:34:54.277 Process ID: 10208
. 2014-07-11 12:34:54.277 Command-line: "C:\Users\jtran\Documents\Visual Studio 2008\Projects\WinSCPTest\WinSCPTest\bin\Debug\winscp.exe" /xmllog="C:\Users\jtran\AppData\Local\Temp\wscp2DA4.0180AB8E.tmp" /xmlgroups /nointeractiveinput /dotnet=553 /ini=nul /log="c:\temp\sftplog.log" /console /consoleinstance=_11684_26966483_88
. 2014-07-11 12:34:54.277 Time zone: Current: GMT-5, Standard: GMT-6 (Central Standard Time), DST: GMT-5 (Central Daylight Time), DST Start: 3/9/2014, DST End: 11/2/2014
. 2014-07-11 12:34:54.277 Login time: Friday, July 11, 2014 12:34:54 PM
. 2014-07-11 12:34:54.277 --------------------------------------------------------------------------
. 2014-07-11 12:34:54.277 Script: Retrospectively logging previous script records:
> 2014-07-11 12:34:54.277 Script: option batch on
< 2014-07-11 12:34:54.277 Script: batch on
> 2014-07-11 12:34:54.277 Script: option confirm off
< 2014-07-11 12:34:54.277 Script: confirm off
> 2014-07-11 12:34:54.277 Script: open -hostkey="ssh-rsa 2048 7a:56:93:e1:70:dd:ba:b3:d6:ac:23:4a:a3:ff:89:aa" -timeout=30 sftp://jctran:***@work.server.com:22
. 2014-07-11 12:34:54.277 --------------------------------------------------------------------------
. 2014-07-11 12:34:54.277 Session name: jctran@work.server.com (Ad-Hoc site)
. 2014-07-11 12:34:54.277 Host name: work.server.com (Port: 22)
. 2014-07-11 12:34:54.278 User name: jctran (Password: Yes, Key file: No)
. 2014-07-11 12:34:54.278 Tunnel: No
. 2014-07-11 12:34:54.278 Transfer Protocol: SFTP
. 2014-07-11 12:34:54.278 Ping type: -, Ping interval: 30 sec; Timeout: 30 sec
. 2014-07-11 12:34:54.278 Proxy: none
. 2014-07-11 12:34:54.278 Send buffer: 262144
. 2014-07-11 12:34:54.278 SSH protocol version: 2; Compression: No
. 2014-07-11 12:34:54.278 Bypass authentication: No
. 2014-07-11 12:34:54.278 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2014-07-11 12:34:54.278 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2014-07-11 12:34:54.278 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2014-07-11 12:34:54.278 Simple channel: Yes
. 2014-07-11 12:34:54.278 Return code variable: Autodetect; Lookup user groups: A
. 2014-07-11 12:34:54.278 Shell: default
. 2014-07-11 12:34:54.278 EOL: 0, UTF: 2
. 2014-07-11 12:34:54.278 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2014-07-11 12:34:54.278 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2014-07-11 12:34:54.278 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2014-07-11 12:34:54.278 Cache directory changes: Yes, Permanent: Yes
. 2014-07-11 12:34:54.278 DST mode: 1; Timezone offset: 0h 0m
. 2014-07-11 12:34:54.278 --------------------------------------------------------------------------
. 2014-07-11 12:34:54.278 Looking up host "work.server.com"
. 2014-07-11 12:34:54.284 Connecting to 10.195.246.237 port 22
. 2014-07-11 12:34:54.450 Server version: SSH-2.0-OpenSSH_4.3
. 2014-07-11 12:34:54.450 Using SSH protocol version 2
. 2014-07-11 12:34:54.450 We claim version: SSH-2.0-WinSCP_release_5.5.3
. 2014-07-11 12:34:54.549 Doing Diffie-Hellman group exchange
. 2014-07-11 12:34:54.715 Doing Diffie-Hellman key exchange with hash SHA-1
. 2014-07-11 12:34:55.001 Verifying host key rsa2 0x23,0xe4e68c89666cddc5 a87b906cb71859b7 0618084102fb3228 96fa6c64753dc4fd d748f62eea39b36d f414bc3a70fa35ba caeb34a1847f4893 a446e8d5b03ad95b b1dd65957cb92ff0 db9b3d84054c8a57 625ca515d3e36eba 7ac1b9b146068d1e cfcfdd7f6901f9aa 204270f0d7a293a9 cfab7a254471bc84 807767d6460dfe14 12f7deb4b2253966 962e00432590195f de28bfc3e7617cc8 89c12678aa4eb772 9303f6247f7d723d 9ea245696652fd06 eb122e8c1a3df007 87c99765bf8dab7e e0bdccc8b69bf0a1 7d3feae9cbcf25a2 104d8594918cb6af ff707e6c22e0add9 c93bb523868ea84c 330d3d5525b73e9d 6817a9d6b54a7b6b c75035d05f8d69ab with fingerprint ssh-rsa 2048 7a:56:93:e1:70:dd:ba:b3:d6:ac:23:4a:a3:ff:89:aa
. 2014-07-11 12:34:55.002 Host key matches configured key
. 2014-07-11 12:34:55.002 Host key fingerprint is:
. 2014-07-11 12:34:55.002 ssh-rsa 2048 7a:56:93:e1:70:dd:ba:b3:d6:ac:23:4a:a3:ff:89:aa
. 2014-07-11 12:34:55.002 Initialised AES-256 SDCTR client->server encryption
. 2014-07-11 12:34:55.002 Initialised HMAC-SHA1 client->server MAC algorithm
. 2014-07-11 12:34:55.002 Initialised AES-256 SDCTR server->client encryption
. 2014-07-11 12:34:55.002 Initialised HMAC-SHA1 server->client MAC algorithm
! 2014-07-11 12:34:55.119 Using username "jctran".
. 2014-07-11 12:34:55.182 Prompt (7, SSH password, , &Password: )
. 2014-07-11 12:34:55.182 Using stored password.
. 2014-07-11 12:34:55.183 Sent password
. 2014-07-11 12:34:55.321 Access granted
. 2014-07-11 12:34:55.322 Opening session as main channel
. 2014-07-11 12:34:55.381 Opened main channel
. 2014-07-11 12:34:55.499 Started a shell/command
. 2014-07-11 12:34:55.499 --------------------------------------------------------------------------
. 2014-07-11 12:34:55.499 Using SFTP protocol.
. 2014-07-11 12:34:55.499 Doing startup conversation with host.
> 2014-07-11 12:34:55.499 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2014-07-11 12:34:55.641 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2014-07-11 12:34:55.641 SFTP version 3 negotiated.
. 2014-07-11 12:34:55.641 We believe the server has signed timestamps bug
. 2014-07-11 12:34:55.641 We will use UTF-8 strings when appropriate
. 2014-07-11 12:34:55.641 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2014-07-11 12:34:55.641 Getting current directory name.
. 2014-07-11 12:34:55.641 Getting real path for '.'
> 2014-07-11 12:34:55.641 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2014-07-11 12:34:55.700 Type: SSH_FXP_NAME, Size: 133, Number: 16
. 2014-07-11 12:34:55.700 Real path is '/nas/edmslz05/application/landing_zone/edms/SWDC/ENT_EWA'
. 2014-07-11 12:34:55.700 Startup conversation with host finished.
< 2014-07-11 12:34:55.701 Script: Active session: [1] jctran@work.server.com
> 2014-07-11 12:34:55.767 Script: get -nopermissions -preservetime -transfer="binary" -- "/nas/edmslz05/application/landing_zone/edms/SWDC/AP_TDocs/TDOCS_Outbound/GROUP779_CTSSWDC010711201410263175//*Detail.txt" "C:\boot\Details\"
. 2014-07-11 12:34:55.767 Listing directory "/nas/edmslz05/application/landing_zone/edms/SWDC/AP_TDocs/TDOCS_Outbound/GROUP779_CTSSWDC010711201410263175".
> 2014-07-11 12:34:55.768 Type: SSH_FXP_OPENDIR, Size: 116, Number: 267
< 2014-07-11 12:34:55.829 Type: SSH_FXP_HANDLE, Size: 13, Number: 267
> 2014-07-11 12:34:55.829 Type: SSH_FXP_READDIR, Size: 13, Number: 524
< 2014-07-11 12:34:55.889 Type: SSH_FXP_NAME, Size: 595, Number: 524
> 2014-07-11 12:34:55.889 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2014-07-11 12:34:55.948 Type: SSH_FXP_STATUS, Size: 28, Number: 780
< 2014-07-11 12:34:55.948 Status code: 1
> 2014-07-11 12:34:55.949 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
. 2014-07-11 12:34:55.949 .;d;4096;2014-07-11T15:35:06.000Z;"tqpdadm" [17319];"edmtiblz" [2304];rwxr-sr-x;2
. 2014-07-11 12:34:55.949 ..;d;2260992;2014-07-11T17:33:39.000Z;"tqpdadm" [17319];"edmtiblz" [2304];rwxrwsr-x;0
. 2014-07-11 12:34:55.949 GROUP779_CTSSWDC010711201410263175-Summary.txt;-;468;2014-07-11T15:35:06.000Z;"tqpdadm" [17319];"edmtiblz" [2304];rw-r--r--;0
. 2014-07-11 12:34:55.949 GROUP779_CTSSWDC010711201410263175-Admin-Detail.txt;-;19768;2014-07-11T15:35:06.000Z;"tqpdadm" [17319];"edmtiblz" [2304];rw-r--r--;0
. 2014-07-11 12:34:55.949 File: '/nas/edmslz05/application/landing_zone/edms/SWDC/AP_TDocs/TDOCS_Outbound/GROUP779_CTSSWDC010711201410263175//GROUP779_CTSSWDC010711201410263175-Admin-Detail.txt' [2014-07-11T15:35:06.000Z] [19768]
. 2014-07-11 12:34:55.949 Copying "/nas/edmslz05/application/landing_zone/edms/SWDC/AP_TDocs/TDOCS_Outbound/GROUP779_CTSSWDC010711201410263175//GROUP779_CTSSWDC010711201410263175-Admin-Detail.txt" to local directory started.
. 2014-07-11 12:34:55.949 Binary transfer mode selected.
. 2014-07-11 12:34:55.949 Opening remote file.
> 2014-07-11 12:34:55.949 Type: SSH_FXP_OPEN, Size: 177, Number: 1283
< 2014-07-11 12:34:56.007 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
. 2014-07-11 12:34:56.007 Discarding reserved response
< 2014-07-11 12:34:56.067 Type: SSH_FXP_HANDLE, Size: 13, Number: 1283
> 2014-07-11 12:34:56.067 Type: SSH_FXP_FSTAT, Size: 13, Number: 1544
< 2014-07-11 12:34:56.211 Type: SSH_FXP_ATTRS, Size: 37, Number: 1544
> 2014-07-11 12:34:56.212 Type: SSH_FXP_READ, Size: 25, Number: 1797
< 2014-07-11 12:34:56.434 Status code: 1
. 2014-07-11 12:34:56.434 14 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2014-07-11 12:34:56.434 Type: SSH_FXP_CLOSE, Size: 13, Number: 4100
< 2014-07-11 12:34:56.493 Type: SSH_FXP_STATUS, Size: 28, Number: 3333
< 2014-07-11 12:34:56.493 Type: SSH_FXP_STATUS, Size: 28, Number: 3589
< 2014-07-11 12:34:56.494 Type: SSH_FXP_STATUS, Size: 28, Number: 3845
. 2014-07-11 12:34:56.494 Preserving timestamp [2014-07-11T15:35:06.000Z]
> 2014-07-11 12:34:56.672 Script: exit
. 2014-07-11 12:34:56.672 Script: Exit code: 0
. 2014-07-11 12:34:56.672 Closing connection.
. 2014-07-11 12:34:56.672 Sending special code: 12
. 2014-07-11 12:34:56.672 Sent EOF message
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Your host key changes:
Quote:
. 2014-07-11 12:34:53.762 ssh-rsa 2048 3d:0f:58:06:7f:3c:d4:81:31:6e:ce:d7:9b:ca:46:3a
...
. 2014-07-11 12:34:55.002 ssh-rsa 2048 7a:56:93:e1:70:dd:ba:b3:d6:ac:23:4a:a3:ff:89:aa

Well actually I would expect that the server behind the host name changes (maybe load balancing).
That's wrong.
You can specify multiple semicolon-separated fingerprints in SessionOptions.SshHostKeyFingerprint.

If the hostkey really changes (i.e. there's no limited/fixed set of fingerprints), you need to contact the server administrator to fix it.
Otherwise the only workaround is to give up on security and use SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey.
https://winscp.net/eng/docs/library_sessionoptions
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License