FtpDLX.Net connection with key file (General questions)

by permission @, (6412 days ago)

Hi

I am trying to use ftpDLX.net to connect to a secure SFTP server for transfer. I have been provided with a ppk file put have no idea how to apply this in order to connect, any help would be greatly appreciated, thanks
code so far is below

Ftp1.Hostname = ConfigurationManager.AppSettings[ FTPServer ];
Ftp1.Login = ConfigurationManager.AppSettings[ FTPUser ];
Ftp1.Password = ConfigurationManager.AppSettings[ FTPPass ];
Ftp1.RemotePath = ConfigurationManager.AppSettings[ FTPDir ];
Ftp1.Protocol = WeOnlyDo.Client.Protocols.SFTP;
Ftp1.Port = 22;

Thanks

locked

Re: FtpDLX.Net connection with key file

by wodDamir @, (6412 days ago) @ permission

Hi,

In order to connect to server using PrivateKey, you should set Authentication and PrivateKey Properties.

I.e:

Ftp1.Authentication = Authentications.PublicKey;
Ftp1.PrivateKey = <....>

I would suggest that you use PuttyGen to convert the key to OpenSSH format, and then convert it to XML string (using .Net classes). After that just Pass it to the component, and it should work.

Hope I helped.

Regards,
Damba

locked

Re: FtpDLX.Net connection with key file

by permission @, (6412 days ago) @ wodDamir

Awesome, so I actualy place the contents of the key file in the Ftp1.PrivateKey value?

But I need to convert the file do I??? Do you have an example of what this should look like once converted??

Thanks

locked

Re: FtpDLX.Net connection with key file

by permission @, (6412 days ago) @ wodDamir

ok, I have managed to convert it to OpenSSH, looks something like this
ssh-rsa AAAAB3NzaC1yc2..........................
just not sure what the XML nodes should be and how to split or convert this into an xml string, checked out the link but nothing on the XML structure required for this object, any ideas where I can grab this or any info on its structure

Thanks again for all your help

locked

Re: FtpDLX.Net connection with key file

by wodDamir @, (6412 days ago) @ permission

Hi,

Actually, that is a Public Key. You need a Private Key. Public key is used on server, while private key is used for the client.

the ToXmlString is supported by many Cryptography classes embedded in .Net. However, you can also simply assign the Private key file contents to the PrivateKey Property. I believe that would work too.

I.e:

Ftp1.PrivateKey = line1 + line2 + etc.

Can you try that?

Regards,
Damba

locked

Re: FtpDLX.Net connection with key file

by permission @, (6412 days ago) @ wodDamir

I get
failed to import Private Key
when I do the sugesstion above, so pretty much write the ppk file to the private key

locked

Re: FtpDLX.Net connection with key file

by wodDamir @, (6411 days ago) @ permission

Hi,

Is there any chance you could send us that key to techsupport@weonlydo.com ?

We'll check it out and let you know how it can be used with wodFtpDLX.Net for connecting to server.

Regards,
Damba

locked

Re: FtpDLX.Net connection with key file

by permission @, (6411 days ago) @ wodDamir

just sent it

thanks

locked