Question

File Transfer from Linux to Windows

Hi All,

I have a couple of requirements which I need to achieve using Linux machine.

  1. I need to transfer 2 files(1 XML & 1 flat file) from Linux machine to windows machine which was build in windows server 2012 r2. And i need to use only sftp to transfer(not Samba Client).
  2. Before sending the files I need to encrypt and send the files to Windows server.

can you please guide me how to design the above requirement.

thanks!


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You could write a quick bash script using SCP/SFTP for transfers and if you are using say OpenSSL:

crypt-send.sh

#!/bin/bash
openssl des3 -salt -in file1.txt -out file1.crypt -pass pass:CHANGEME
openssl des3 -salt -in file2.txt -out file2.crypt -pass pass:CHANGEME
# This is the SCP Option
scp <file to upload> <username>@<hostname>:<destination path>
scp <file to upload> <username>@<hostname>:<destination path>
# This is the SFTP Option (Make Batch File)
sftp -b files.list username@hostname

If you want to use SFTP or SCP setup keys, but if you need to do SFTP option too use the batch option just put this into a files.list file with this script:

cd some-path/
binary
put file1.crypt
put file2.crypt
quit

See if that helps!