scp(安全复制)到没有密码的 ec2 实例 [英] scp (secure copy) to ec2 instance without password

查看:17
本文介绍了scp(安全复制)到没有密码的 ec2 实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 EC2 实例正在运行(FreeBSD 9 AMI ami-8cce3fe5),我可以使用我的亚马逊创建的密钥文件 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:

任何想法为什么会发生这种情况/如何预防?

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

推荐答案

我想通了.我的论点顺序错误.这有效:

I figured it out. I had the arguments in the wrong order. This works:

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

这篇关于scp(安全复制)到没有密码的 ec2 实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆