SCP(安全复制)到EC2实例没有密码实例、密码、安全、SCP

2023-09-11 08:06:35 作者:念欢

我在运行(FreeBSD的9阿美阿美-8cce3fe5)的EC2实例,我可以ssh到它使用我的亚马逊创建的密钥文件,没有密码的提示,没有问题。

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.

不过,当我想使用scp我被要求输入密码才能将文件复制到该实例:

However, when I want to copy a file to the instance using scp I am asked to enter a password:

scp somefile.txt -i mykey.pem root@my.ec2.id.amazonaws.com:/

Password:

任何想法,为什么发生这种情况/怎么能说是prevented?

Any ideas why this is happening/how it can be prevented?

在此先感谢!

霍夫

推荐答案

想通了,有错误的顺序参数,这个工程:

figured it out, had the arguments in the wrong order, this works:

scp -i  mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/