wodSFTP/wodKeys problem (wodSFTP / wodSFTP.NET / wodSFTPdll)
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
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
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
Steve,
Please remove On Error Resume Next and let us know which error occur.
Drazen
Re: wodSFTP/wodKeys problem
Steve,
… also can you please try code we send as a clean sample? What happened?
Drazen
Re: wodSFTP/wodKeys problem
The error is Run-time error '-1 (ffffffff)' Unrecognized Error
(not much help)
Re: wodSFTP/wodKeys problem
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
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
No error, it successfully prints the Public key.
Re: wodSFTP/wodKeys problem
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