title: SCP Permission denied (publickey). on EC2 only when using -r flag on directories
body: <p><code>scp -r /Applications/XAMPP/htdocs/keypairfile.pem uploads ec2-user@publicdns:/var/www/html</code></p>
  
  <p>where uploads is a directory returns  Permission denied (publickey). </p>
  
  <p>However</p>
  
  <p><code>scp -i /Applications/XAMPP/htdocs/keypairfile.pem footer.php ec2-user@publicdns:/var/www/html</code></p>
  
  <p>works <strong>(notice the flag change).</strong></p>
  
  <p>uploads is an empty folder</p>
  
  <p>These are the file permissions for the uploads directory </p>
  
  <p><code>drwxrwxrwx   3 geoffreysangston  admin     102 Nov 15 01:40 uploads</code></p>
  
  <p>These are the file permissions for /var/www/html</p>
  
  <p><code>drwxr-x--- 2 ec2-user ec2-user 4096 Jan  5 20:45 html</code></p>
  
  <p>I've tried changing html to 777 and that doesn't work either.</p>