Windows SSH – Setting Up FTP Over SSH

ftpsftpsshwindows

We have quite a lot of scripts that are used to upload and download files with a vendor on the Internet using the Windows supplied ftp.exe. This is proxied via SideWinder and is FTP out to the vendor, however they support SFTP.

We make use of ftp -s:filename which Specifies a text file containing FTP commands; the commands will automatically run after FTP starts.

ftp -n -s:dir\filename.ftp proxy.example.com

What we would like to do is tunnel this over the Windows supplied ssh.exe so that we can eliminate the SideWinder proxy and continue to use the existing filename files for the FTP commands.

Is this possible using the Windows supplied ssh.exe and ftp.exe and what would be the configuration?

I do know that there are SFTP programs out there for free. We're trying accomplish this with minimal changes to the existing system. Hopefully it is as simple as an SSH connection in the script prior to the FTP connection and operations.

Best Answer

I know this is not the answer you want, but I strongly recommend switching to SFTP.

First of all, SFTP is a different protocol, it's not just FTP over an SSH tunnel. So proxying ftp.exe over ssh.exe won't work, unless you want to access an FTP server behind an SSH tunnel.

Personally, I'd recommend switching to WinSCP, it's free, it has a very good Powershell support, so you could easily write a PowerShell script to parse your current file and execute the required commands using WinSCP instead.