title: Transfer a file from EC2 linux instance to a Windows system
body: <p>I have one scheduled task on an EC2 linux system and it is generating a file daily. Now I want to transfer this file from that to another Windows machine that is not on AWS.</p>
  
  <p>I want to schedule this job on the EC2 instance only. I don't want to download it from target machine, I want the upload facility from EC2.</p>
  
  <p>I have tried below command:</p>
  
  <pre><code>scp -i (Key File for my current EC2 instance) (IP of target):(Local file path of current EC2 instance) D:\TEMP(Target Path of window machine)
  </code></pre>
  
  <p>I am getting:</p>
  
  <pre><code>ssh: connect to host (IP of target) port 22: Connection refused
  </code></pre>
  
  <p>We already have a functionality to store the file in S3 but it depends on the task of EC2 instance. (Sometimes it takes 1 hour or sometimes it takes 4 hours, that's why I want it at end of this task.)</p>