File Transfer from Linux to Windows

Posted April 13, 2017 7.9k views
Arch LinuxApplications

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.


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.

Submit an Answer
1 answer

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

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/
put file1.crypt
put file2.crypt

See if that helps!