Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

TimU

brettrsmithjr wrote:

OK, so how am I supposed to do it if I do not have a password, just a username and a ftp site with port information?

1) Have you been given the private key by the S/FTP site administrator, or have you generated one yourself?
2) Were you given the key in PPK or OpenSSH format?

Assuming (please check & confirm) that you've been supplied with the Private Key, and that it's in PPK format, you can use this command to establish your connection with the S/FTP site:
open <protocol>://<username>@<hostname> -privatekey="<FullPathToKeyFile>.ppk" -hostkey="<your servers host key>"


example:
open sftp://SFTPUser@SFTPServer.domain.local -privatekey="D:\sftp\keys\SFTPUser.ppk" -hostkey="ssh-rsa 1024 e2:dd:11:2e:82:32:ab:62:59:1c:c8:62:1d:2b:28:99"


brettrsmithjr wrote:

I also want to know how can I write this in C#?

See here for C# programming help.
brettrsmithjr

OK, so how am I supposed to do it if I do not have a password, just a username and a ftp site with port information? I also want to know how can I write this in C#?
brettrsmithjr

.PPK file and upload automation in C#

I was able to run and activate the WinSCP.com file, but how do you script with C# how to include a username, a private PPK file to open the sftp gateway and then upload a file from a network directory? I would greatly appreciate your help. Thanks