SCP Permission denied (publickey). on EC2 only when using -r flag on directories
问题 scp -r /Applications/XAMPP/htdocs/keypairfile.pem uploads ec2-user@publicdns:/var/www/html where uploads is a directory returns Permission denied (publickey). However scp -i /Applications/XAMPP/htdocs/keypairfile.pem footer.php ec2-user@publicdns:/var/www/html works (notice the flag change). uploads is an empty folder These are the file permissions for the uploads directory drwxrwxrwx 3 geoffreysangston admin 102 Nov 15 01:40 uploads These are the file permissions for /var/www/html drwxr-x---