Authentication Property - WeOnlyDo Discussion board

Authentication Property (wodFtpDLX / wodFtpDLX.NET)

by kdcarlisle, Thursday, May 28, 2009, 14:28 (5659 days ago)

I have created a powershell cmdlet that does various ftp (get/put/remove) actions. The cmdlet can run in all three modes (ftp/ftps/sftp). I recently updated the code to also support private/public keys for ssh. When I did this I changed the Authentication property to be Authentications.Both.

I just found out yesterday that if I use ssh with a user-name/password (no key), then the .Connect method fails with 'failed to import private key'. I have debugged the code to ensure that the KeyManager code block was not being executed (since there is no key).

I have worked around this issue by checked to see if a ssh keyfile is present when the cmdlet is run. If it is then I set the Authentication property to Authentications.PublicKey else Authentications.Password.

-Kent

Re: Authentication Property

by woddrazen, Thursday, May 28, 2009, 15:04 (5659 days ago) @ kdcarlisle

Hi Kent,


Thanks for shearing this solution with us.


Regards,
Drazen