linux - 无法将文件从 ubuntu scp 到 Amazon EC2

标签 linux unix ubuntu hadoop ssh

我正在运行 sch 命令并收到以下错误,谁能告诉我那是什么?

xxxxxxxxx@ubuntu:~/Downloads$ sudo scp -v "word_count.jar" ubuntu@54.68.0.10:/usr/
Executing: program /usr/bin/ssh host 54.68.0.10, user ubuntu, command scp -v -t /usr/
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 54.68.0.10 [54.68.0.10] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA e3:5f:e0:7e:be:e4:ca:bd:a3:51:de:12:11:a9:e0:22
debug1: Host '54.68.0.10' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
lost connection

我基本上是在尝试将文件发送到从本地计算机运行 Ubuntu 的 Amazon EC2 计算机。

最佳答案

在大多数情况下,EC2 节点配置为需要使用身份文件进行 key 身份验证。

这就是为什么您的调试输出以:

结尾
debug1: Authentications that can continue: publickey

debug1: Next authentication method: publickey

debug1: Trying private key: /root/.ssh/id_rsa

debug1: Trying private key: /root/.ssh/id_dsa

debug1: Trying private key: /root/.ssh/id_ecdsa

debug1: Trying private key: /root/.ssh/id_ed25519

debug1: No more authentication methods to try.

Permission denied (publickey).

找到身份文件,然后发出您的 scp 命令:

scp -vi identity_file.pem word_count.jar ubuntu@54.68.0.10:/usr/

关于linux - 无法将文件从 ubuntu scp 到 Amazon EC2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26478378/

相关文章:

c++ - 如何向 rijndael.h 添加 PKCS7 填充?

linux - 我搞砸了在 Ubuntu 上设置 ufw 防火墙,无法再登录到我的服务器

linux - 获取指向 argv[0] 的指针,以便我可以更改它

linux - 在@INC 中找不到 Mojo/DOM.pm(您可以安装 Mojo::DOM 模块)(@INC 包含:/etc/perl/usr/local/lib/x86_64-linux-gnu/perl/5.30. 2)

python - 如何以与 shell 无关、与语言无关的方式从命令行获取当前 Linux 进程 ID

linux - 在脚本中为特定日期添加动态天数

linux - gzip 和管道输出(性能考虑)

java - 将特殊变量 (~ 波形符) 传递给 Java 程序

regex - 使用正则表达式提取子字符串同时排除某个短语

c++ - 在不释放内存的情况下调用共享库