本文翻译自:scp (secure copy) to ec2 instance without password
I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created key file without password prompt, no problem. 我有一个正在运行的EC2实例(FreeBSD 9 AMI ami-8cce3fe5),我可以使用我的亚马逊创建的密钥文件将其ssh进入,而无需输入密码提示,没有问题。
However, when I want to copy a file to the instance using scp I am asked to enter a password: 但是,当我想使用scp将文件复制到实例时,要求输入密码:
scp somefile.txt -i mykey.pem root@my.ec2.id.amazonaws.com:/
Password:
Any ideas why this is happening/how it can be prevented? 有什么想法为什么会发生/如何预防?
#1楼
参考: