wodSFTP/wodKeys problem - WeOnlyDo Discussion board

wodSFTP/wodKeys problem (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Steve, Friday, March 28, 2008, 14:55 (5882 days ago)

I am attempting to connect to an openSSH server using wodSFTP and public/private key exchange.

I have generated a pair of keys, installed the public key on the server and successfully connected using puTTY and the private key.

When I attempt to create a connection using your sample application for public key authentication I cannot connect. No error message, but after a timeout, the app prints a status of Disconnected .

If I turn Blocking on and attempt to connect, the connect attempt returns with an error code of -1 .

Here is a code fragment from the connect routine:

On Error Resume Next
Set SFTP1 = New wodSFTPCom
SFTP1.HostName = Text3.Text
SFTP1.Login = Text4.Text
'sftp1.password = not needed!!!!

SFTP1.Authentication = authPubkey
SFTP1.PrivateKey = SSHKeys.PrivateKey(Combo1.ListIndex)
SFTP1.Blocking = True
SFTP1.Connect
'Stop
If Err <> 0 Then
Text5.Text = Error: & Err.Description
Else
Text5.Text = Connecting...
End If
Stop
SFTP1.ListDir /

Not sure what to try next?

Re: wodSFTP/wodKeys problem

by wodDamir, Friday, March 28, 2008, 14:59 (5882 days ago) @ Steve

Hi Steve,

Can you please try something like this:

http://www.weonlydo.com/index.asp?kb=1&View=entry&EntryID=55

Basically, you call the Load method for the key, and then pass the Key object to PrivateKey property.

Could you try that? Does that work?

Regards,
Damba

Re: wodSFTP/wodKeys problem

by Steve, Friday, March 28, 2008, 15:09 (5882 days ago) @ wodDamir

So here's the new code fragment:

On Error Resume Next
Set SFTP1 = New wodSFTPCom
SFTP1.HostName = Text3.Text
SFTP1.Login = Text4.Text
'sftp1.password = not needed!!!!
SSHKeys.Load f:
ewprivatekeyputty.ppk

SFTP1.Authentication = authPubkey
SFTP1.PrivateKey = SSHKeys
SFTP1.Blocking = True
SFTP1.Connect
'Stop
If Err <> 0 Then
Text5.Text = Error: & Err.Description
Else
Text5.Text = Connecting...
End If
Stop
SFTP1.ListDir /

Same error, with Blocking on, a -1 .

Re: wodSFTP/wodKeys problem

by woddrazen, Friday, March 28, 2008, 15:16 (5882 days ago) @ Steve

Steve,


Please remove On Error Resume Next and let us know which error occur.

Drazen

Re: wodSFTP/wodKeys problem

by woddrazen, Friday, March 28, 2008, 15:18 (5882 days ago) @ woddrazen

Steve,


… also can you please try code we send as a clean sample? What happened?


Drazen

Re: wodSFTP/wodKeys problem

by Steve, Friday, March 28, 2008, 15:20 (5882 days ago) @ woddrazen

The error is Run-time error '-1 (ffffffff)' Unrecognized Error

(not much help)

Re: wodSFTP/wodKeys problem

by Steve, Friday, March 28, 2008, 15:29 (5882 days ago) @ Steve

I created a simple project with just this code:

Option Explicit
Dim Keys As WODSSHKeyLib.Keys
Dim WithEvents SFTP1 As wodSFTPCom

Private Sub Form_Load()
Dim Key As Keys
Set SFTP1 = New wodSFTPCom
Set Key = New Keys

Key.Load f:newprivatekeyputty.ppk

SFTP1.HostName = hba-barr-cbas
SFTP1.Authentication = authPubkey
SFTP1.Login = sshuser
SFTP1.PrivateKey = Key
SFTP1.Blocking = True
SFTP1.Connect
Debug.Print SFTP1.StateText
Stop
End Sub


Same error, -1

Re: wodSFTP/wodKeys problem

by woddrazen, Friday, March 28, 2008, 15:36 (5882 days ago) @ Steve

Steve,


We will need to isolate this problem. Can you please try this code:

[code]Set Key = New Keys

Key.Load f:\newprivatekeyputty.ppk
Debug.Print key.PublicKeyOpenSSH(RSAkey)[/code]

and let us know if error occur.


Drazen

Re: wodSFTP/wodKeys problem

by Steve, Friday, March 28, 2008, 15:55 (5882 days ago) @ woddrazen

No error, it successfully prints the Public key.

Re: wodSFTP/wodKeys problem

by woddrazen, Friday, March 28, 2008, 16:21 (5882 days ago) @ Steve

Steve,


Is there any chance that we could connect there? We will just connect few times duplicate issue and immediately disconnect.

You can send you private information to techsupport@weonlydo.com


Drazen