- martin
Post a reply
Topic review
- TimU
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"
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#?
- martin
Re: .PPK file and upload automation in C#
For a general guide see
https://winscp.net/eng/docs/guide_automation
https://winscp.net/eng/docs/scriptcommand_open
https://winscp.net/eng/docs/session_url
https://winscp.net/eng/docs/scriptcommand_put
https://winscp.net/eng/docs/guide_automation
how do you script with C# how to include a username, a private PPK file to open the sftp gateway
https://winscp.net/eng/docs/scriptcommand_open
https://winscp.net/eng/docs/session_url
and then upload a file from a network directory?
https://winscp.net/eng/docs/scriptcommand_put
- 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