Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review


script to automate winscp file download with certificate authentication

thanks Martin

I am able to connect to FTPS using -privatekey and command link interface
open sftp://test1:test123;fingerprint=ssh-rsa-xxxxxxxxxxxxxx -privatekey=<Filepath> -passphrase=XXXXX

Next step is to download any new file in the remote directory (filename_xxxx.csv) to local directory....and write to a log file and send a status mail alert to specific email id.
can you help with this ?


Re: script to automate winscp file download with certificate authentication

SFTP does not use client certificates.
So either you mean private key (used with SFTP/SSH).
Or you mean FTPS (which uses TLS/SSL and hence the certificates).

For private key, use the -privatekey switch.
For client certificate, use the -clientcert switch.

In any case, you have have the GUI generate the script for you:

Script to automate WinSCP file download with certificate authentication

I am working on a script which will automate the downloading of files from remote sftp server.
The issue is certificate authentication
Right now I am using WinSCP GUI and in the Advanced settings of the WinSCP session with remote server I have supplied the SSL certificate.
WinSCP connects to remote server using this certificate and once sessions is established I go to a remote directory and copy a file to local directory.
I need to automate this and schedule it so that in every 30 minutes the script is run and if a new file is copied to remote server directory, it will be copied to the local directory.
I have one script which works fine for FTP but for SFTP with certificate I need help in creating a script which can be used to connect to remote SFTP server passing on certificate authentication and download the file.