Ssh 无法通过scp复制多个文件

Ssh 无法通过scp复制多个文件,ssh,amazon-ec2,scp,Ssh,Amazon Ec2,Scp,此用于连接到我的aws服务器的命令运行良好: ssh -i my_pem.pem ubuntu@ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com $ ssh -v -i 123.pem ubuntu@xx-xx-xx-xx.xx-west-1.compute.amazonaws.com OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/s

此用于连接到我的aws服务器的命令运行良好:

ssh -i my_pem.pem ubuntu@ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com
$ ssh -v -i 123.pem ubuntu@xx-xx-xx-xx.xx-west-1.compute.amazonaws.com
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 xx-xx-xx-xx.xx-west-1.compute.amazonaws.com [11.22.33.44] port 22.
debug1: Connection established.
debug1: identity file docs/toh_server.pem type -1
debug1: identity file docs/toh_server.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4 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 xx:bb:cc:dd:ee:fdsfdsfdsfdsfdsfds
debug1: Host 'xx-xx-xx-xx.xx-west-1.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/me123/.ssh/known_hosts:19
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
debug1: Next authentication method: publickey
debug1: Trying private key: docs/toh_server.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to xx-xx-xx-xx.xx-west-1.compute.amazonaws.com ([11.33.44.55]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_HK.UTF-8
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

 System information disabled due to load higher than 2.0

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud
但这并不是:

$ scp -v -i my_pem.pem file1 file2 ubuntu@ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com:/home/ubuntu/folder1
更新1

ssh -i my_pem.pem ubuntu@ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com
$ ssh -v -i 123.pem ubuntu@xx-xx-xx-xx.xx-west-1.compute.amazonaws.com
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 xx-xx-xx-xx.xx-west-1.compute.amazonaws.com [11.22.33.44] port 22.
debug1: Connection established.
debug1: identity file docs/toh_server.pem type -1
debug1: identity file docs/toh_server.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4 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 xx:bb:cc:dd:ee:fdsfdsfdsfdsfdsfds
debug1: Host 'xx-xx-xx-xx.xx-west-1.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/me123/.ssh/known_hosts:19
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
debug1: Next authentication method: publickey
debug1: Trying private key: docs/toh_server.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to xx-xx-xx-xx.xx-west-1.compute.amazonaws.com ([11.33.44.55]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_HK.UTF-8
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

 System information disabled due to load higher than 2.0

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud
错误:

Executing: program /usr/bin/ssh host ip-xx-xx-xx-xx, user ubuntu, command scp -v -d -t /home/ubuntu/folder1
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 *
ssh: Could not resolve hostname ip-xx-xx-xx-xx: Name or service not known
lost connection
怎么了?

看到区别了吗

debug1: Connecting to xx-xx-xx-xx.xx-west-1.compute.amazonaws.com [11.22.33.44] port 22.

您的
scp
正在连接其他地方,由于您混淆了IP/地址,我不知道这是有意的还是真的

scp
正在解析您的文件,可能在您的文件名中发现了一些
字符(关于
@
的第一个猜测是错误的),并将该文件名解析为
主机:路径
?只使用其中一个文件进行尝试,张贴文件的真实名称

或者使用
sftp
。它不关心命令行上的语法。只需
sftp您的主机
,然后:

cd folder1
put my_file file2
看到区别了吗

debug1: Connecting to xx-xx-xx-xx.xx-west-1.compute.amazonaws.com [11.22.33.44] port 22.

您的
scp
正在连接其他地方,由于您混淆了IP/地址,我不知道这是有意的还是真的

scp
正在解析您的文件,可能在您的文件名中发现了一些
字符(关于
@
的第一个猜测是错误的),并将该文件名解析为
主机:路径
?只使用其中一个文件进行尝试,张贴文件的真实名称

或者使用
sftp
。它不关心命令行上的语法。只需
sftp您的主机
,然后:

cd folder1
put my_file file2

-v stsnd的用途是什么?为什么不使用相同的dyntax,只是-i@datelligence,为什么不打开文档?“无法解析主机名”看起来不像是scp和更多文件的问题,而是您的网络问题。您的
~/.ssh/config
文件中有什么内容?尝试在命令行中添加更多的
-vvv
,以查看更多日志。您的主机名在从
scp
ssh
@Jakuje的过程中丢失了,那么,“ssh”为什么会起作用呢?@Jakuje,我应该在ssh/config文件中包含什么?-v stsnd用于什么?为什么不使用相同的dyntax,只是-i@datelligence,为什么不打开文档?“无法解析主机名”
scp
和更多文件看起来没有问题,但您的网络有问题。您的
~/.ssh/config
文件中有什么内容?尝试在命令行中添加更多的
-vvv
,以查看更多日志。您的主机名在从
scp
ssh
@Jakuje的过程中丢失了,那么,“ssh”为什么起作用呢?@Jakuje,ssh/config文件中应该有什么?您的scp正在连接其他地方,由于您混淆了IP/地址,我认为这只是一个真实的IP地址,因为在命令中我使用了主机名,您的scp正在连接其他地方,由于您混淆了IP/地址,我认为这只是一个真实的IP地址,因为在命令中我使用主机名