Rsync to Amazon Ec2 Instance

前端 未结 5 966
面向向阳花
面向向阳花 2020-12-07 18:52

I have an EC2 instance running and I am able to SSH into it.

However, when I try to rsync, it gives me the error Permission denied (publickey).

The command

5条回答
  •  庸人自扰
    2020-12-07 19:46

    copy file from local machine to server

    rsync -avz -e "ssh -i /path/to/key.pem" /path/to/file.txt  @:/path/to/directory/
    

    copy file from server to local machine

    rsync -avz -e "ssh -i /path/to/key.pem" @:/path/to/directory/file.txt  /path/to/directory/
    

提交回复
热议问题