EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP Connection lost

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 02/04/2008 19:25:21
by Chris Almond (Standard support level)
Joined: 02/04/2008
Posts: 7

SBSimpleSftp.EElSimpleSFTPClientException: Connection lost

Anybody been able to use any port other than 22 for SFTP. I get this error thrown immediately when I try and set the port to 9922. Is this a bug or am I doing something wrong? I have version

Here is some of the code:

Public Sub Connect()

objSFTPClient = New SBSimpleSftp.TElSimpleSFTPClient

objSFTPClient.Address = strRemoteHost ' "claimstest.scmedicaid.com"
objSFTPClient.Port = intPort '22
objSFTPClient.Username = strUser ' "M00348FL3"
objSFTPClient.Password = strPassword ' "m00348fl3"


Catch ex As Exception
Throw (ex)
End Try

End Sub
Posted: 02/05/2008 00:09:47
by Eugene Mayevski (EldoS Corp.)

Please see the article in the knowledgebase. It was written after the numerous questions in the Forum similar to yours.

Sincerely yours
Eugene Mayevski
Posted: 02/06/2008 16:23:50
by Chris Almond (Standard support level)
Joined: 02/04/2008
Posts: 7

Thank you for your reply but please excuse my ignorance here...
I reviewed the article you referenced in the Knowledgebase and tried several items with no avail. See below:

1) "Turn off compression ... via CompressionAlgorithms property of client component."
--> I set CompressionAlgorithms with index 0 and 1 to false, no difference.
2) "Run the sample applications ..."
--> After changing the port number to 9922 in the code of both SFTP sample applications I receive the same error as my code: "SFTP connection failed: Connection failed"
4) "Check the log of the sample project"
--> I was unable to locate any log files for either SFTP sample projects.
5) ".. AutoAdjustCiphers property. Try turning this property on ..."
--> ELSimpleSftpClient class does not contain an "AutoAdjustCiphers" property.
6) "When you use key-based authentication, you need to load the keys correctly: ..."
--> With the SimpleSFTP sample client I tried loading a valid key pair and received the same error message.
7) "... your user account doesn't allow you to access the server using ..."
--> I am able to access the same SFTP server using CUTE FTP Pro with the same credentials and port number.
8) "... check and adust Versions property of the client component."
--> Tested with versions 1-6 using SimpleSFTPclientdemo and same error.

I would really appreciate some help here. Has anyone successfully connected to a host SFTP system via port 9922 using SimpleSFTPClient? Any ideas on what my issue is?

Posted: 02/07/2008 01:23:27
by Eugene Mayevski (EldoS Corp.)

The port number itself doesn't matter. It looks like TCP connection could not be established at all.
Please check with your firewalls - you probably have this port blocked (or you have all ports but 22 and other known ports blocked).

Sincerely yours
Eugene Mayevski
Posted: 02/07/2008 08:57:52
by Chris Almond (Standard support level)
Joined: 02/04/2008
Posts: 7

Thanks for the reply. I'm able to connect via port 9922 using CuteFTP on my development machine so I don't believe we have a firewall issue here.

Posted: 02/07/2008 10:45:32
by Eugene Mayevski (EldoS Corp.)

1) Try calling "telnet <your server> 9922" from command line and see the reply from the server (if there's any)
2) Please copy the exact text of the log messages from the client. Maybe I just don't understand your problem right.

Sincerely yours
Eugene Mayevski
Posted: 02/07/2008 16:05:01
by Chris Almond (Standard support level)
Joined: 02/04/2008
Posts: 7

C:\>telnet qa-ftp.availity.com 9922


Connection to host lost.


I'm using the client under
C:\Program Files\EldoS\SecureBlackbox.NET\Samples\VB.NET\SFTPBlackbox\SimpleSFTPDemo
where do I find the log files for this?

If you want the exact log message from my client which I have developed using the SimpleSFTP classes, they are as follows:

2/6/2008 3:47:11 PM | SBSimpleSftp.EElSimpleSFTPClientException: Connection lost
at TheraSourceEdiCA.SFTP.Connect() in C:\Documents and Settings\calmond\My Documents\Visual Studio Projects\TheraSourceEdiCA\TheraSourceEdiCA\SFTP.vb:line 95
at TheraSourceEdiCA.TheraSourceEDI.SendFilesSFTP(Int32 intEdiGateId, DataView dvTransactions) in C:\Documents and Settings\calmond\My Documents\Visual Studio Projects\TheraSourceEdiCA\TheraSourceEdiCA\TheraSourceEDI.vb:line 138

Thanks for your help.
Posted: 02/08/2008 00:15:38
by Eugene Mayevski (EldoS Corp.)

Chris Almond wrote:
where do I find the log files for this?

At the bottom of the Sample's main form there's a log that shows connection progress. We need that output for better understanding of the problem.

Sincerely yours
Eugene Mayevski
Posted: 02/08/2008 08:28:33
by Chris Almond (Standard support level)
Joined: 02/04/2008
Posts: 7

Sure, no problem.

ElSimpleSftpClient Demo Application

Connection properties
Host: qa-ftp.availity.com
username: testv07328
Private key file ...: <blank>

Time | Event
9:27:25AM SFTP connection failed: Connection lost

Below you can see where I changed the port number in the Connect() sub:

Private Sub Connect()
Dim dlg As frmConnProps

If SftpClient.Active Then
System.Windows.Forms.MessageBox.Show(Me, "Already connected")
Exit Sub
End If
dlg = New frmConnProps
If (dlg.ShowDialog(Me) = Windows.Forms.DialogResult.OK) Then
SftpClient.Username = dlg.tbUsername.Text
SftpClient.Password = dlg.tbPassword.Text
SftpClient.Address = dlg.tbHost.Text
SftpClient.Port = 9922

Posted: 02/08/2008 09:15:55
by Eugene Mayevski (EldoS Corp.)

Great that you have specified the host name.

The client connects fine to this server. Please try setting AutoAdjustCiphers property to false and re-try the instructions in the FAQ text that you tried initially. The client must connect with some combination of options as it does here.

Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.



Topic viewed 13289 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!