Windows FTP over SSL using WinScp

I'm running Windows 2008 FTP Server and have configured the ftp server to allow SSL connections. I have created my self-sign certificate and done all of the configs on the server side.

I want to be able to in to the ftp server securely and upload a file. I need help with a winscp script file that connects to my server using encrypted authentication along with encrypted data transfer.
abgtempAsked:
Who is Participating?
 
abgtempConnect With a Mentor Author Commented:
One correction. I used ftps:// instead of ftp://

C:\winscp.com /console /script=c:\ftpcmds


**********************
FTPCMDS File Contents
**********************
option batch abort
option confirm off
open ftps://ftpuser:password@myserver.com -explicitssl -explicittls -certificate="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" 
option transfer binary
put d:\file.txt
close
exit

Open in new window

0
 
jpgobertEnterprise IT Systems ConsultantCommented:
I'm not clear on what exactly you need help with..?  You say you've already done the server side configuration so that FTPs is working, right?

What part of the WinSCP script do you need help with?  What exactly do you want the script to do?

Need more details to be able to help...
0
 
bevhostCommented:
There is a command line utility that works like WinSCP,

You can download from this page
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

or using this link
http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe

for docs and howto info
http://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter5.html#pscp
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Dave BaldwinFixer of ProblemsCommented:
WinSCP and related programs use SSH, not SSL.  SSH is a different and incompatible encryption method.  To use WinSCP, you need an SSH server installed on your machine.  The Filezilla client and server support FTPS (FTP over SSL): https://filezilla-project.org/
0
 
jpgobertEnterprise IT Systems ConsultantCommented:
Sorry DavidBaldwin but that's not true... WinSCP has support for FTP over SSL... it's just not in the GUI.  I just used the WinSCP command line version and opened a connection to my FTPS server and it worked fine.
0
 
AlexPaceCommented:
I believe basic FTPS support was added to WinSCP in version 4.2.  I don't know if it is scriptable like the SFTP engine.

You said that you need "encrypted authentication along with encrypted data transfer."

In terms of FTPS, this means you want both the control channel and the data channel to be protected.  Different FTPS clients have different default behaviors in this regard... some default to only protecting the control channel because that runs faster.  You'll have to check the WinSCP docs to be sure.

I use RoboFTP for scripting FTPS transfers and it has the /trust option you can add to your script so that it won't choke the first time it sees your self-signed certificate... so look for an option like that in winscp if you are going to distribute the script and don't want to support users that complain about having to acknowledge and accept the cert...  in RoboFTP the connection command syntax would be something like:

FTPLOGON "svr.mydomain.tld" /user="UserID" /pw="secret" /servertype=FTPS /trust=all
0
 
abgtempAuthor Commented:
I want to run it from the command line using the following command and script file for it to process.


 winscp.exe /console /script=c:\ftpcmds


**********************
FTPCMDS
**********************

option confirm off
open ftp://ftpuser@myserver.com:21 -certificate="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" 
option transfer binary
put d:\file.txt
close
exit

Open in new window





What I'm not clear on is the following questions when connecting

1. Should I be using ftps:// or ftp://
2. Which other flags should I be using to ensure my credentials are encrypted and the data I am sending?  (-explicitssl -explicittls)?
0
 
abgtempAuthor Commented:
I was able to figure out the commands I needed. My final command was:

C:\winscp.com /console /script=c:\ftpcmds


**********************
FTPCMDS File Contents
**********************
option batch abort
option confirm off
open ftp://ftpuser:password@myserver.com -explicitssl -explicittls -certificate="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" 
option transfer binary
put d:\file.txt
close
exit

Open in new window



I set the FTP server on my Windows box to Require that the Control Path and Data Path be encrypted.
0
 
abgtempAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for abgtemp's comment #a39181292

for the following reason:

No one else answered my question
0
 
bevhostCommented:
Well if you asked the question correctly maybe you would have got the answer you seeked
0
 
bevhostCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.