【问题标题】:unable to scp file from ubuntu to Amazon EC2无法将文件从 ubuntu scp 到 Amazon EC2
【发布时间】:2014-12-16 04:28:56
【问题描述】:

我正在运行 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 机器发送文件。

【问题讨论】:

    标签: linux unix ubuntu hadoop ssh


    【解决方案1】:

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

    这就是您的调试输出以以下结尾的原因:

    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/
    

    【讨论】:

      猜你喜欢
      • 2012-07-08
      • 2011-11-10
      • 2015-10-25
      • 2013-05-27
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      • 2015-01-10
      • 2021-04-12
      相关资源
      最近更新 更多