使用SCP将文件复制到Amazon EC2实例? [英] Using scp to copy a file to Amazon EC2 instance?

查看:1669
本文介绍了使用SCP将文件复制到Amazon EC2实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用我的Mac终端来使用scp从下载的文件(phpMyAdmin的我在网上下载),到我的Amazon EC2实例。

I am trying to use my Mac Terminal to scp a file from Downloads (phpMyAdmin I downloaded online) to my Amazon EC2 instance.

我使用的命令是:

scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all-languages.tar.gz  hk22@mec2-50-17-16-67.compute-1.amazonaws.com:~/.

错误我: 警告:标识文件myAmazonKey.pem无法访问:没有这样的文件或目录。 权限被拒绝(公钥)。 失去连接

The error I got: Warning: Identity file myAmazonKey.pem not accessible: No such file or directory. Permission denied (publickey). lost connection

我的两个m​​yAmazonkey.pem和的phpMyAdmin-3.4.5-全languages​​.tar.gz都在下载,所以后来我试图

Both my myAmazonkey.pem and phpMyAdmin-3.4.5-all-languages.tar.gz are in Downloads, so then I tried

scp -i /Users/Hello_Kitty22/Downloads/myAmazonKey.pem /Users/Hello_Kitty22/Downloads/phpMyAdmin-3.4.5-all-languages.tar.gz  hk22@mec2-50-17-16-67.compute-1.amazonaws.com:~/.

和我得到了错误: 警告:标识文件/User/Hello_Kitty22/Downloads/myAmazonkey.pem无法访问:没有这样的文件或目录。 权限被拒绝(公钥)。 失去连接

and the error I got: Warning: Identity file /User/Hello_Kitty22/Downloads/myAmazonkey.pem not accessible: No such file or directory. Permission denied (publickey). lost connection

谁能告诉我如何解决我的问题?

Can anyone please tell me how to fix my problem?

P.S。还有一个类似的帖子:<一href="http://stackoverflow.com/questions/6558080/scp-secure-copy-to-ec2-instance-without-password">scp (安全复制)到EC2实例没有密码 但它并没有回答我的问题。

p.s. there is a similar post: scp (secure copy) to ec2 instance without password but it doesn't answer my question.

推荐答案

尝试指定用户是 EC2用户,例如:

Try specifying the user to be ec2-user, e.g.

scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all-languages.tar.gz ec2-user@mec2-50-17-16-67.compute-1.amazonaws.com:~/.

请参阅<一href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html">Connecting要使用SSH 的Linux / UNIX实例。

See Connecting to Linux/UNIX Instances Using SSH.

这篇关于使用SCP将文件复制到Amazon EC2实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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