SCP 传输不起作用且 SSH ls 冻结

SCP 传输不起作用且 SSH ls 冻结

我正在尝试使用 SSH-RSA 公钥通过 ssh 复制一些文件。我已经在服务器中接受了主机密钥,反之亦然,因此密钥已同步。现在我尝试通过 SSH 连接到主机并成功,但如果我在某些文件夹中调用“ls”,它会冻结。我还尝试执行 scp 请求,如下所示:

scp -v username@host_ip:/folder/folder1/file.txt /home/user/Desktop

我得到了这个答案:

OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <ip_host> [<ip_host>] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: Host '<ip_host>' is known and matches the RSA host key.
debug1: ssh_rsa_verify: signature correct
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = fr_FR.UTF-8
debug1: Sending command: scp -v -f /folder/folder1/file.txt
Sending file modes: C0664 3352 file.txt
Sink: C0664 3352 file.txt
file.txt                                0%    0     0.0KB/s   --:-- ETA^
file.txt                                0%    0     0.0KB/s - stalled -^

我搜索过,也尝试过将 MTU 从 1500 改为 1492,但没有任何变化。有人知道会发生什么吗?非常感谢。

答案1

通过将接口中的 MTU 从默认的 1500 降低到 1470 以下的值,问题得到了解决。

要在 RHEL 环境中修复 MTU(我的环境是这样的):

编辑 /etc/sysconfig/network-scripts/ifcfg-eth0:

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

添加MTU,设置:

MTU="1452"

保存并关闭文件。重新启动网络:

# service network restart

相关内容