EldoS | Feel safer!

Software components for data protection, secure storage and transfer

connection to SFTP failed

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#8956
Posted: 02/18/2009 08:39:54
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

hi,

I use TElSimpleSFTPClient to connect to our remote SFTP server with password authentication mode, but it's failed. I have tested with your demo SSHServer, it's all correct.
here is the log. what does mean OpenSSH_3.8.1p1? thanks

2009-02-18 09:11:55: Connecting to 206.162.160.18 ...

2009-02-18 09:11:56: Server key [7d7fe03e172c0d13893e2204d57b47e3] received

2009-02-18 09:11:56: Server key [7d7fe03e172c0d13893e2204d57b47e3] received

2009-02-18 09:11:56: Authentication type [16] failed

2009-02-18 09:11:56: Authentication type [4] failed

2009-02-18 09:11:56: Error 114

2009-02-18 09:11:56: Connection failed due to exception: Connection lost (error code is 10058)

2009-02-18 09:11:56: Server software identified itself as: OpenSSH_3.8.1p1
#8959
Posted: 02/18/2009 09:12:11
by Eugene Mayevski (EldoS Corp.)

OpenSSH_3.8.1p1 is the server identification string. Please re-read authentication error messages and check the error code in documentation. This will answer your question.


Sincerely yours
Eugene Mayevski
#8963
Posted: 02/18/2009 14:13:18
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

I get an error, when connecting to server

Connection failed due to exception: Wrong socket state 4 in Init (error code is 96258)

how to fix it?

thanks
#8964
Posted: 02/18/2009 14:45:38
by Eugene Mayevski (EldoS Corp.)

Did you try to do basic search before asking? Please DO search for information before asking your questions -- all your questions have been asked and answered many times before. Doing search before (and instead of) posting will save first of all your own time.

SEARCH HERE


Sincerely yours
Eugene Mayevski
#8972
Posted: 02/19/2009 08:32:24
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

private void InitializeComponent()
{
...
// SftpClient
//
this.SftpClient.ClientHostname = "";
this.SftpClient.ClientUsername = "";
this.SftpClient.CompressionLevel = 6;
this.SftpClient.ForceCompression = false;
this.SftpClient.set_CompressionAlgorithms(0, false);// added
this.SftpClient.KeyStorage = null;
this.SftpClient.Password = "";
this.SftpClient.SFTPExt = null;
this.SftpClient.SoftwareName = "EldoS.SFTPBlackbox.5";
this.SftpClient.Username = "";
this.SftpClient.Versions = ((short)(28));
//this.SftpClient.AutoAdjustCiphers = false;//true has tried this.SftpClient.OnKeyValidate += new SBSSHCommon.TSSHKeyValidateEvent(this.SftpClient_OnKeyValidate);
this.SftpClient.OnAuthenticationSuccess += new SBUtils.TNotifyEvent(this.SftpClient_OnAuthenticationSuccess);
this.SftpClient.OnAuthenticationKeyboard += new SBSSHCommon.TSSHAuthenticationKeyboardEvent(SftpClient_OnAuthenticationKeyboard);
this.SftpClient.OnCloseConnection += new SBSSHCommon.TSSHCloseConnectionEvent(this.SftpClient_OnCloseConnection);
this.SftpClient.OnError += new SBSSHCommon.TSSHErrorEvent(this.SftpClient_OnError);
this.SftpClient.MessageLoop += new SBSftpCommon.TSBSftpMessageLoopEvent(this.SftpClient_MessageLoop);
this.SftpClient.OnAuthenticationFailed += new SBSSHCommon.TSSHAuthenticationFailedEvent(this.SftpClient_OnAuthenticationFailed);
this.SftpClient.OnProgress += new SBUtils.TSBProgressEvent(this.SftpClient_OnProgress);
...
}

I have tried adding:

this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_FIRST, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_3DES, true);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_DES, true);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_BLOWFISH, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH192, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES192, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT192, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_ARCFOUR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_IDEA, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_CAST128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_NONE, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES192_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES256_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_3DES_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_BLOWFISH_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH192_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH256_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT192_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT256_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_IDEA_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_CAST128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_ARCFOUR128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_ARCFOUR256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_LAST, false);

any other suggestion??
thank you
#8973
Posted: 02/19/2009 08:34:09
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

Thank you for your help,
I read all articles concern this issue, and I test with both SimpleSftpClient client and SophisticatedClient, they dont work with OpenSSH_3.8.1p1. but FileZilla Client works with same username and password.

I modified some properties in SimpleSftpClient as below, il doesn't work.
08:43:55: Authentication type [4] failed
08:43:55: Error 114
08:43:55: Connection failed due to exception: Connection lost (error code is 10058)


private void InitializeComponent()
{
...
// SftpClient
//
this.SftpClient.ClientHostname = "";
this.SftpClient.ClientUsername = "";
this.SftpClient.CompressionLevel = 6;
this.SftpClient.ForceCompression = false;
this.SftpClient.set_CompressionAlgorithms(0, false);// added
this.SftpClient.KeyStorage = null;
this.SftpClient.Password = "";
this.SftpClient.SFTPExt = null;
this.SftpClient.SoftwareName = "EldoS.SFTPBlackbox.5";
this.SftpClient.Username = "";
this.SftpClient.Versions = ((short)(28));
//this.SftpClient.AutoAdjustCiphers = false;//true has tried this.SftpClient.OnKeyValidate += new SBSSHCommon.TSSHKeyValidateEvent(this.SftpClient_OnKeyValidate);
this.SftpClient.OnAuthenticationSuccess += new SBUtils.TNotifyEvent(this.SftpClient_OnAuthenticationSuccess);
this.SftpClient.OnAuthenticationKeyboard += new SBSSHCommon.TSSHAuthenticationKeyboardEvent(SftpClient_OnAuthenticationKeyboard);
this.SftpClient.OnCloseConnection += new SBSSHCommon.TSSHCloseConnectionEvent(this.SftpClient_OnCloseConnection);
this.SftpClient.OnError += new SBSSHCommon.TSSHErrorEvent(this.SftpClient_OnError);
this.SftpClient.MessageLoop += new SBSftpCommon.TSBSftpMessageLoopEvent(this.SftpClient_MessageLoop);
this.SftpClient.OnAuthenticationFailed += new SBSSHCommon.TSSHAuthenticationFailedEvent(this.SftpClient_OnAuthenticationFailed);
this.SftpClient.OnProgress += new SBUtils.TSBProgressEvent(this.SftpClient_OnProgress);
...
}

I have tried adding:

this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_FIRST, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_3DES, true);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_DES, true);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_BLOWFISH, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH192, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES192, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT192, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_ARCFOUR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_IDEA, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_CAST128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_NONE, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES192_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_AES256_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_3DES_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_BLOWFISH_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH192_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_TWOFISH256_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT192_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_SERPENT256_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_IDEA_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_CAST128_CTR, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_ARCFOUR128, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_ARCFOUR256, false);
this.SftpClient.set_EncryptionAlgorithms(SBSSHConstants.__Global.SSH_EA_LAST, false);

any other suggestion??
thank you
#8974
Posted: 02/19/2009 08:36:37
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

the line should be two lines:

//this.SftpClient.AutoAdjustCiphers = false;//true has tried

this.SftpClient.OnKeyValidate += new SBSSHCommon.TSSHKeyValidateEvent(this.SftpClient_OnKeyValidate);
#8975
Posted: 02/19/2009 08:57:32
by Santiago CastaƱo (Standard support level)
Joined: 04/16/2006
Posts: 155

Hi y song,

I work with openssh all the time and i don't get any error, I work with your openssh version, OpenSSH_4.3p2 Debian-9 and others, quite a lot as we have customers always with openssh but with many versions between them.

I see that you're putting OnAuthenticationKeyboard and you're not entering a username, you should specify the login username at least (but the demo just runs fine, and you said you tested it)

Also, set AuthenticationTypes to SSH_AUTH_TYPE_KEYBOARD or SSH_AUTH_TYPE_PASSWORD.

Also, read your sshd_config and look at the PasswordAuthentication and ChallengeResponseAuthentication or post your sshd_config.

Maybe it could be interesting that in failures you do in linux a "tail /var/log/auth.log" to see the error sshd is throwing.

If it's not that, it may be related with the posts eugene told.

Hope it helps or gives you any clue.
#8978
Posted: 02/19/2009 10:28:44
by y song (Basic support level)
Joined: 02/10/2009
Posts: 12

thank you Santiago Castaño,
what I modified is in SimpleSftpClient,
this.SftpClient.OnAuthenticationKeyboard += new SBSSHCommon.TSSHAuthenticationKeyboardEvent
this event is never fired in my case.

Before SftpClient.Open() is called; AuthenticationTypes is set to SSH_AUTH_TYPE_KEYBOARD
I have asked our client who has OpenSSH_3.8.1p1 to send us sshd_config.

It seems SFTPBlackbox doesn't work with OpenSSH_3.8.1p1, which version is too old.

Perhaps I have to use a SFTP client that has command line mode.
#8979
Posted: 02/19/2009 11:00:40
by Ken Ivanov (EldoS Corp.)

Quote
08:43:55: Authentication type [4] failed
08:43:55: Error 114
08:43:55: Connection failed due to exception: Connection lost (error code is 10058)

As Eugene said, please use a search on the site. It might have already helped you to get answers for all your questions.

The error messages you are getting say that (a) password ("4") authentication has failed and, consequently, (b) the overall authentication process has failed ("error 114").

Please
(a) As Santiago pointed, set proper username and password values,
(b) enable SSH_AUTH_TYPE_PASSWORD authentication type,
© remove the OnAuthenticationKeyboard event handler.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 8921 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!