SCP Permission denied (publickey). on EC2 only when using -r flag on directories

前端 未结 5 743
轻奢々
轻奢々 2021-01-30 10:41

scp -r /Applications/XAMPP/htdocs/keypairfile.pem uploads ec2-user@publicdns:/var/www/html

where uploads is a directory returns Permission denied (publicke

5条回答
  •  深忆病人
    2021-01-30 10:56

    The -i flag specifies the private key (.pem file) to use. If you don't specify that flag (as in your first command) it will use your default ssh key (usually under ~/.ssh/).

    So in your first command, you are actually asking scp to upload the .pem file itself using your default ssh key. I don't think that is what you want.

    Try instead with:

    scp -r -i /Applications/XAMPP/htdocs/keypairfile.pem uploads/* ec2-user@publicdns:/var/www/html/uploads
    

提交回复
热议问题