代码之家  ›  专栏  ›  技术社区  ›  Paolo

两个EC2实例之间的文件传输

  •  0
  • Paolo  · 技术社区  · 7 年前

    我正计划将一个站点从一个实例转移到另一个实例。因为它是一个很大的站点,我相信最好直接将文件从一个实例复制到另一个实例。

    https://blog.e-zest.com/how-to-do-scp-from-one-ec2-instance-to-another-ec2-instance/ https://blog.microideation.com/2016/05/26/secure-copy-files-scp-between-two-ec2-instances-in-aws/

    但是,使用此命令:

    scp -v test.txt root@x.x.x.x:/home/test_dest.txt
    

    我得到这个错误:

    Executing: program /usr/bin/ssh host x.x.x.x, user root, command scp -v -t /home/test_dest.txt
    OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 56: Applying options for *
    debug1: Connecting to x.x.x.x [x.x.x.x] 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.1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
    debug1: match: OpenSSH_6.6.1 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: kex: curve25519-sha256@libssh.org need=16 dh_need=16
    debug1: kex: curve25519-sha256@libssh.org need=16 dh_need=16
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ECDSA 69:bc:99:1d:e8:09:4f:ce:4a:7f:70:45:a3:1f:06:99
    debug1: Host 'x.x.x.x' is known and matches the ECDSA host key.
    debug1: Found key in /root/.ssh/known_hosts:1
    debug1: ssh_ecdsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
    debug1: Next authentication method: gssapi-keyex
    debug1: No valid Key exchange context
    debug1: Next authentication method: gssapi-with-mic
    debug1: Unspecified GSS failure.  Minor code may provide more information
    No Kerberos credentials available (default cache: KEYRING:persistent:0)
    
    debug1: Unspecified GSS failure.  Minor code may provide more information
    No Kerberos credentials available (default cache: KEYRING:persistent:0)
    
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /root/.ssh/id_rsa
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
    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,gssapi-keyex,gssapi-with-mic).
    lost connection
    

    所以有几个问题:

    1. 上面的错误是什么意思?我该怎么修?
    2. 我还需要检查什么才能使SCP工作?
    0 回复  |  直到 7 年前