title: ssh and scp fails to transfer file
body: <p>I'm trying to copy a file from my local machine to an EC2 instance. If I do</p>
  
  <pre><code>ssh &lt;hostname&gt;
  </code></pre>
  
  <p>everything works fine. I also checked that there are enough disk space on destination machine, and I have write permission. Now when I do</p>
  
  <pre><code>scp file &lt;hostname&gt;:
  </code></pre>
  
  <p>I get a <code>Write failed: Broken pipe</code> error. I tried doing <code>scp -vvv</code>, but everything looked normal up until the error. The strange thing is that if I check the destination machine, EXACTLY 32768 bytes were copied. Also if I try</p>
  
  <pre><code>&lt;file ssh &lt;hostname&gt; "cat &gt; file"
  </code></pre>
  
  <p>This time EXACTLY 16384 bytes get copied, and fails with the same error. Any ideas why this could be happening?</p>
  
  <p>Thanks in advance!</p>
  
  <p>P.S. Copying files smaller than 32K works just fine.</p>