Amazon ec2 AmazonEC2的scp挂起,但SSH工作正常

Amazon ec2 AmazonEC2的scp挂起,但SSH工作正常,amazon-ec2,scp,Amazon Ec2,Scp,我正在尝试将文件从ec2实例复制到本地计算机。命令如下: scp -v -i commoncrawl_practice.pem ec2-user@ec2-54-86-8-91.compute-1.amazonaws.com:/home/ec2-user/testfile . 这里是它悬挂的地方: debug1: Trying private key: commoncrawl_practice.pem debug1: read PEM private key done: type RSA deb

我正在尝试将文件从ec2实例复制到本地计算机。命令如下:

scp -v -i commoncrawl_practice.pem ec2-user@ec2-54-86-8-91.compute-1.amazonaws.com:/home/ec2-user/testfile .
这里是它悬挂的地方:

debug1: Trying private key: commoncrawl_practice.pem
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to ec2-54-86-8-91.compute-1.amazonaws.com ([54.86.8.91]: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_US.UTF-8
debug1: Sending command: scp -v -f /home/ec2-user/testfile

提前感谢。

尝试使用SFTP替代SCP。

检查目的地是否有~/.bashrc文件,用于将内容打印到终端。如果是,请通过插入来禁用非交互式壳

[[ $- == *i* ]] || return
在打印任何东西之前


(在上找到解决方案)

您可以通过ssh连接到计算机吗
scp
使用
ssh
作为传输协议。是的,请参阅标题。SSH工作正常。请尝试复制到其他目录,而不是
/home/ec2 user/testfile
不工作的目录。仍然挂起。您可以尝试从其他客户端,尝试缩小服务器或客户端的问题范围。