EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Unable to connect using sFTP

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#18544
Posted: 12/21/2011 11:06:49
by Diego Schonhals (Basic support level)
Joined: 12/20/2011
Posts: 10

Hi Team, I can not connect to the sFTP using SecureBlackBox.

This is the code I'm using. Do you have any clues?

Code
Sub TestFTP()
Dim LicenseMgr, Client
      Set LicenseMgr = CreateObject("BaseBBox8.ElSBLicenseManagerX")      
       LicenseMgr.SetLicenseKey ("8343...1648")
        If Not IsObject(LicenseMgr) Then
                Wscript.StdErr.WriteLine "Failed to create ElSBLicenseManagerX. Remember to register ActiveX controls."
                Exit Sub
        End If      
        Set Client = Server.CreateObject("SFTPBBoxCli8.ElSimpleSFTPClientX")        
        If IsObject(Client) Then                      
                Client.Address = "12.35.45.65"                
                Client.Port = "22"                
                Client.Username = "timecent"
                Client.Password = "pass"                
                On Error Resume Next
                Client.Open()
                If Not Client.Active Then
                        error =  "Failed to connect to host"
                Else
                        error =  "Connected fine"
                        Client.Close
                End If
        Else
                error = "Failed to create SimpleSFTPClientX. Remember to register ActiveX controls."
        End If
End Sub



This is the log of FileZilla client


Firstly appears this message on FileZilla:

"The Server's host is unknown. You have no guarantee that the server is the computer you think it is
Details
Host: 12.35.45.65:22
Fingerprint: (long string here)

Trust this host and carry on connecting: OK, Cancel

Then If I click on OK, log result is:

Status: Waiting to retry...
Status: Connecting to 12.35.45.65...
Response: fzSftp started
Command: open "timecent@12.35.45.65" 22
Command: Trust new Hostkey: Once
Command: Pass: ********
Status: Connected to 12.35.45.65
Status: Retrieving directory listing...
Command: pwd
Response: Current directory is: "/timecent"
Command: ls
Status: Listing directory /timecent
Status: Calculating timezone offset of server...
Command: mtime ".sh_history"
Response: 1321645801
Status: Timezone offsets: Server: -18000 seconds. Local: -18000 seconds. Difference: 0 seconds.
Status: Directory listing successful

Any clue why I can not connect using ElDos component? Thanks
#18545
Posted: 12/21/2011 11:19:31
by Ken Ivanov (EldoS Corp.)

1) Do you get any particular errors reported by the ASP environment?

2) Please handle the OnError, OnAuthenticationFailed, OnAuthenticationSuccess and OnKeyValidate events. While the first three will help to track authentication failures, the last is really a must (the component won't let you in unless you return Validate = True from the OnKeyValidate handler).
#18546
Posted: 12/21/2011 11:53:26
by Diego Schonhals (Basic support level)
Joined: 12/20/2011
Posts: 10

I received error = -1. Also I tried the VB6 demo and it's not connecting.
What can I do? Only I added: hostName (IP), user, password, port(22)

Please suggest something

Diego
#18547
Posted: 12/21/2011 11:59:55
by Ken Ivanov (EldoS Corp.)

Quote
I received error = -1.

Which exactly line of code returns the error?

Quote
Also I tried the VB6 demo and it's not connecting.

Are there any errors reported in the demo's log (at the bottom of the main window)?

At first glance it seems to be a component registration issue. Please run the following commands and try to run the sample again (let's proceed with the sample for now):

regsvr32 BaseBBox8.dll
regsvr32 SSHBBoxCli8.dll
regsvr32 SFTPBBoxCli8.dll
#18548
Posted: 12/21/2011 12:26:37
by Diego Schonhals (Basic support level)
Joined: 12/20/2011
Posts: 10

How do you say the component to always trust?

Error log for demo application is:

line 1)Connecting to 12.35.45.65
line 2)Error: Connection failed (error code is -1)
line 3,4,5) Contact Eldos support....

I unregistered dll and then registered again in the order you wrote above. What's more can I do?

Thanks
#18549
Posted: 12/21/2011 12:31:11
by Diego Schonhals (Basic support level)
Joined: 12/20/2011
Posts: 10

On demo version I received error = -1, on this line

SftpClient.Open


Method is:

Private Sub Connect()

form: frmMain
#18550
Posted: 12/21/2011 12:45:34
by Ken Ivanov (EldoS Corp.)

Do you have any firewall running on your system? It looks pretty much like the firewall blocking the application from connecting to the remote host.

Quote
How do you say the component to always trust?

This is done as I explained above - by handling the OnKeyValidate event and returning Valid = True from inside the handler.
#18551
Posted: 12/21/2011 14:25:49
by Diego Schonhals (Basic support level)
Joined: 12/20/2011
Posts: 10

My machine was blocked by the server. I used another machine not blocked by the firewall and worked perfect. Thanks very much for the help. The key was to register the libraries typed above.

Thanks
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

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