Re: Bug 948
This is my log
And what is your code like?
This is my log
sOs.AddRawSettings("TunnelHostKey", "ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c");
. 2012-12-04 16:32:42.475 [Tunnel] Server version: SSH-2.0-OpenSSH_5.3
. 2012-12-04 16:32:42.475 [Tunnel] Using SSH protocol version 2
. 2012-12-04 16:32:42.475 [Tunnel] We claim version: SSH-2.0-WinSCP_release_5.1.2
. 2012-12-04 16:32:42.480 [Tunnel] Doing Diffie-Hellman group exchange
. 2012-12-04 16:32:42.526 [Tunnel] Doing Diffie-Hellman key exchange with hash SHA-1
. 2012-12-04 16:32:42.681 [Tunnel] Verifying host key rsa2 0x23,0xb9e7a68722066c319d939feda1a6d13b43bf281167f0c04336c267a7ad927faeae9eed689161f8d0a5a9ee3c7cdae47d611ad471c357e74dda0ebaed7e13a82d0f023b9247811622cda40dfe8c9366dfad8ef93beeb7b6575dbafca6801386e8f5ab51b5b179af3425f1000b847caa9a40782f784fdc0b4db709b69db2035f6b6c61d56cbfa2a7f9a861bbbf81a01c5d20b831d246fc61adfec4ed9dd587e6c559ed150b9c8dbb06642bbbbab886d4caa47ae4257fa05d5f7200e6c54b8cff85c582063b9d47c000faf865f290a50deb770e9aef1b44b241ee3947bfac2a244759ae6c7b343a6472b3dfbc84986ddbce2593d8d82bc236b617e9719c464547f3 with fingerprint ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c
. 2012-12-04 16:32:42.681 Asking user:
. 2012-12-04 16:32:42.681 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.
. 2012-12-04 16:32:42.681
. 2012-12-04 16:32:42.681 The server's rsa2 key fingerprint is:
. 2012-12-04 16:32:42.681 ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c
. 2012-12-04 16:32:42.681
. 2012-12-04 16:32:42.681 If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
. 2012-12-04 16:32:42.681
. 2012-12-04 16:32:42.681 Continue connecting and add host key to the cache? ()
. 2012-12-04 16:32:42.681 [Tunnel] Closing connection.
. 2012-12-04 16:32:42.681 [Tunnel] Sending special code: 12
SessionOptions sOs = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "<SSHOST>.jp",
PortNumber = 22222,
UserName = "<USER>",
Password = "<PASSWD>",
SshHostKeyFingerprint = "ssh-rsa 2048 cb:79:b4:2d:52:c1:eb:ce:32:be:0f:6d:40:fc:5f:c2"
};
using (Session session = new Session())
{
sOs.AddRawSettings("TunnelHostKey", "ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c");
sOs.AddRawSettings("Tunnel", "1");
sOs.AddRawSettings("TunnelHostName", "<TUNNELHOST>.jp");
sOs.AddRawSettings("TunnelPortNumber", "22222");
sOs.AddRawSettings("TunnelUserName", "<TUNNELUSER>");
sOs.AddRawSettings("TunnelPublicKeyFile", @"I:\My Docs\privkey.ppk");
session.SessionLogPath = @"I:\VC# Projects\C#2010\scptest\SesLog.txt";
session.Open(sOs);
. 2012-11-19 20:39:15.628 [Tunnel] We claim version: SSH-2.0-WinSCP_release_5.1.1
I have sent you a dev version 5.2. You are using official 5.1.1. It does not support the TunnerHostKey.
[2012-11-23 11:47:30.727Z] [0009] Command: [open -hostkey="ssh-rsa 2048 cb:79:b4:2d:52:c1:eb:ce:32:be:0f:6d:40:fc:5f:c2" -timeout=15 "sftp://<USER>:<PASSWD>@<SSHHOST>.jp:22222" -rawsettings Tunnel="1" TunnelHostKey="ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c" TunnelHostName="<TUNNELHOST>.jp" TunnelPortNumber="22222" TunnelUserName="<TUNNELUSER>"]
<snip>
[2012-11-23 12:30:03.645Z] [000a] Output: [Authenticating...]
[2012-11-23 12:30:03.649Z] [000b] ExeSessionProcess.ProcessEvent entering
[2012-11-23 12:30:03.650Z] [000b] Scheduling output: [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.]
[2012-11-23 12:30:03.650Z] [000b] Scheduling output: [The server's rsa2 key fingerprint is:]
[2012-11-23 12:30:03.651Z] [000a] Output: [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.]
[2012-11-23 12:30:03.652Z] [000b] Scheduling output: [ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c]
. 2012-11-19 20:39:15.628 [Tunnel] We claim version: SSH-2.0-WinSCP_release_5.1.1
Error: WinSCP.SessionRemoteException: Host key wasn't verified! ---> WinSCP.SessionRemoteException: Host key fingerprint is ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c.
Authentication failed.
--- 内部例外スタック トレースの終わり ---
場所 WinSCP.SessionLogReader.Read(LogReadFlags flags)
場所 WinSCP.ElementLogReader.Read(LogReadFlags flags)
場所 WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
場所 WinSCP.Session.Open(SessionOptions sessionOptions)
場所 scptest.Form1.button1_Click(Object sender, EventArgs e) 場所 I:\VC# Projects\C#2012\scptest\scptest\Form1.cs:行 56
SshHostKeyFingerprint = "ssh-rsa 2048 cb:79:b4:2d:52:c1:eb:ce:32:be:0f:6d:40:fc:5f:c2"
sOs.AddRawSettings("TunnelHostKey", "ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c");
. 2012-11-19 20:39:15.628 [Tunnel] Server version: SSH-2.0-OpenSSH_5.3
. 2012-11-19 20:39:15.628 [Tunnel] Using SSH protocol version 2
. 2012-11-19 20:39:15.628 [Tunnel] We claim version: SSH-2.0-WinSCP_release_5.1.1
. 2012-11-19 20:39:15.633 [Tunnel] Doing Diffie-Hellman group exchange
. 2012-11-19 20:39:15.678 [Tunnel] Doing Diffie-Hellman key exchange with hash SHA-1
. 2012-11-19 20:39:15.829 [Tunnel] Verifying host key rsa2 0x23,0xb9e7a68722066c319d939feda1.... with fingerprint ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c
. 2012-11-19 20:39:15.830 Asking user:
. 2012-11-19 20:39:15.830 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.
. 2012-11-19 20:39:15.830
. 2012-11-19 20:39:15.830 The server's rsa2 key fingerprint is:
. 2012-11-19 20:39:15.830 ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c
. 2012-11-19 20:39:15.830
. 2012-11-19 20:39:15.830 If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
. 2012-11-19 20:39:15.830
. 2012-11-19 20:39:15.830 Continue connecting and add host key to the cache? ()
. 2012-11-19 20:39:15.830 [Tunnel] Closing connection.
. 2012-11-19 20:39:15.830 [Tunnel] Sending special code: 12
Error: WinSCP.SessionRemoteException: Host key wasn't verified! ---> WinSCP.SessionRemoteException: Host key fingerprint is ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c.
Authentication failed.
--- 内部例外スタック トレースの終わり ---
場所 WinSCP.SessionLogReader.Read(LogReadFlags flags)
場所 WinSCP.ElementLogReader.Read(LogReadFlags flags)
場所 WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
場所 WinSCP.Session.Open(SessionOptions sessionOptions)
場所 scptest.Form1.button1_Click(Object sender, EventArgs e) 場所 I:\VC# Projects\C#2010\scptest\scptest\Form1.cs:行 58
// Setup session options
SessionOptions sOs = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "HOSTNAME.xxx.xxx.ne.jp",
PortNumber = 54322,
UserName = "<USERNAME>",
Password = "password"
,
SshHostKeyFingerprint = "ssh-rsa 2048 cb:79:b4:2d:52:c1:eb:ce:32:be:0f:6d:40:fc:5f:c2"
};
using (Session session = new Session())
{
// Overwrite ?
sOs.AddRawSettings("HostKey", "ssh-rsa 2048 7e:c8:9e:c7:7a:26:54:c0:65:5a:13:14:36:2f:cf:7c;ssh-rsa 2048 cb:79:b4:2d:52:c1:eb:ce:32:be:0f:6d:40:fc:5f:c2");
sOs.AddRawSettings("Tunnel", "1");
sOs.AddRawSettings("TunnelHostName", "TNLHOST.xxx.xxx.ne.jp");
sOs.AddRawSettings("TunnelPortNumber", "54322");
sOs.AddRawSettings("TunnelUserName", "<TNLUSER>");
sOs.AddRawSettings("TunnelPublicKeyFile", "tnluser.ppk");
session.SessionLogPath = @"I:\VC# Projects\C#2010\scptest\SesLog1.txt";
session.Open(sOs);
}
Yes. I've sent you new build for testing while ago.
Anyway, 5.1.1 has been released meanwhile with TunnelHostKey raw session settings added for you.
https://winscp.net/tracker/938
Error: WinSCP.SessionRemoteException: Host key wasn't verified! ---> WinSCP.SessionRemoteException: Host key fingerprint is ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Authentication failed.
--- 内部例外スタック トレースの終わり ---
場所 WinSCP.SessionLogReader.Read(LogReadFlags flags)
場所 WinSCP.ElementLogReader.Read(LogReadFlags flags)
場所 WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
場所 WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
場所 WinSCP.Session.Open(SessionOptions sessionOptions)
場所 scptest.Form1.button1_Click(Object sender, EventArgs e) 場所 I:\VCSProj\scptest\scptest\Form1.cs:行 57
SessionOptions sOs = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "<MyServerFQDN>",
PortNumber = <Port>,
UserName = "<UserName>",
Password = "<PassWd>" ,
SshHostKeyFingerprint = "<Tunnel Server's FingerPrint>;<MyServer's FingerPrint>"
};
using (Session session = new Session())
{
// Connect
sOs.AddRawSettings("Tunnel", "1");
sOs.AddRawSettings("TunnelHostName", "<MyTunnelServer>");
sOs.AddRawSettings("TunnelPortNumber", "<TunnelPort>");
sOs.AddRawSettings("TunnelUserName", "<TunnelUser>");
sOs.AddRawSettings("TunnelPublicKeyFile", "<TunnelUser'sPPK>");
session.Open(sOs);
}
SessionOptions.SshHostKeyFingerprint
to any valid value to circumvent the check. The raw settings overrides its value anyway.
SessionOptions sOs = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "<MyServerFQDN>",
PortNumber = <Port>,
UserName = "<UserName>",
Password = "<PassWd>"
//,
// SshHostKeyFingerprint = "<MyServer'sFingerPrint>"
};
using (Session session = new Session())
{
// Connect
sOs.AddRawSettings("HostKey", "<MyServer'sFingerPrint>;<Tunnel Server's Fingerprint>");
sOs.AddRawSettings("Tunnel", "1");
sOs.AddRawSettings("TunnelHostName", "<MyTunnelServer>");
sOs.AddRawSettings("TunnelPortNumber", "<TunnelPort>");
sOs.AddRawSettings("TunnelUserName", "<TunnelUser>");
sOs.AddRawSettings("TunnelPublicKeyFile", "<TunnelUser'sPPK>");
session.Open(sOs);
}
Error: System.ArgumentException: SessionOptions.Protocol is Protocol.Sftp or Protocol.Scp, but SessionOptions.HostKey is not set.
場所 WinSCP.Session.SessionOptionsToOpenSwitches(SessionOptions sessionOptions)
場所 WinSCP.Session.SessionOptionsToOpenArguments(SessionOptions sessionOptions)
場所 WinSCP.Session.Open(SessionOptions sessionOptions)
場所 scptest.Form1.button1_Click(Object sender, EventArgs e) 場所 I:\VCSProj\scptest\scptest\Form1.cs:行 57
ssh-rsa 2048 xx:xx:xx:.....:xx
as my fingerprints format when I set them by AddRawSettings
, is it correct?
winscp.ini
strings)
SshHostKeyFingerprint
, separated by semicolon.
AddRawSettings("HostKey", "hostkey1;hostkey2")
SessionOptions sOs = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "<MyServerFQDN>",
PortNumber = <Port>,
UserName = "<UserName>",
Password = "<PassWd>",
SshHostKeyFingerprint = "<MyServer'sFingerPrint>"
};
using (Session session = new Session())
{
// Connect
sOs.AddRawSettings("Tunnel", "1");
sOs.AddRawSettings("TunnelHostName", "<MyTunnelServer");
sOs.AddRawSettings("TunnelPortNumber", "<TunnelPort>");
sOs.AddRawSettings("TunnelUserName", "<TunnelUser>");
sOs.AddRawSettings("TunnelPublicKeyFile", "<TunnelUser'sPPK>");
session.Open(sOs);
}
Error: WinSCP.SessionRemoteException: Host key wasn't verified! ---> WinSCP.SessionRemoteException: Host key fingerprint is <Tunnel Server's Fingerprint>
Authentication failed.
[SshHostKeys]
section in the WinSCP.ini
file, but I could not use it.