PublicKey auth in vbs (General questions)
Hi I'm doing some test with the trial version of wodSFTP in vbs.
After a successfull connection using login/password, I adapted your example like this to try PrivateKey/PublicKey authentication:
Option Explicit
Dim objFTP, lst, objFS, objKeys, key
Set objFTP = WScript.CreateObject( WeOnlyDo.wodSFTPCom.1 , wod_ )
Set objKeys = WScript.CreateObject( WeOnlyDo.Keys.1 )
key= PathToMyPrivateKey
objFTP.Hostname = MyHostName
objFTP.Login = MyUserName
objKeys.Load key
objFTP.PrivateKey = objKeys.PrivateKey(0)
objFTP.Blocking = 1
objFTP.Connect
objFTP.ListDir ( / )
lst = objFTP.ListItem
WScript.echo lst
objFTP.Disconnect
Sub wod_Connected(ErrorCode, ErrorText)
WScript.Echo Connected & ErrorText
End Sub
Sub wod_Disconnected()
WScript.Echo Disconnected
End Sub
When executing this, I always get:
wodSFTP.vbs(15, 1) WeOnlyDo.wodSFTPCom.1: Please set login, and password/privatekey first.
Could you please help me, because I don't see what I'm doing wrong?
Many thanks!
Tim.