title: SFTP To Amazon S3 is failing with error "couldn't close file"
body: <p>I'm copying a file from my local machine to Amazon S3 using SFTP on the command line. The user is configured to use KMS
  The connection opens succesfully, and the file transfers, but at the end, I'm getting this error and the transfer fails</p>
  <p>the connection is opened, and then cd into the bucket and the file uploaded with these commands</p>
  <pre><code>sftp &lt;AWS username&gt;@&lt;AWS Host&gt;
  cd &lt;s3 bucket name&gt;/&lt;folder&gt;
  put myFile.txt
  </code></pre>
  <p>The put transfer gets to 100%, but then the following error is logged</p>
  <pre><code>Uploading myFile.txt to /myS3Bucket/myFolder
  myFile.txt      100%  174     4.9KB/s   00:00
  Couldn't close file: Permission denied
  </code></pre>
  <p>Do you know what could be causing this, and how to resolve it?</p>