首页 > 解决方案 > packet_write_wait:连接到@host 端口 22:管道损坏

问题描述

我正在尝试使用 scp 命令将一些文件从生产服务器(ubuntu 16.04)复制到备份服务器(ubuntu 16.04),但得到

packet_write_wait: Connection to @host port 22: Broken pipe
Lost connection

我试过添加

-o ServerAliveInterval=30 -o ServerAliveCountMax=5

来自 https://superuser.com/questions/1331240/packet-write-wait-connection-to-xxx-port-3591-broken-pipe https://superuser.com/questions/1331240/packet-write-wait- connection-to-xxx-port-3591-broken-pipe https://superuser.com/questions/1137584/packet-write-wait-broken-pipe-error-on-macos-sierra-ssh 但随后它开始抛出

Timeout, server @host not responding.
lost connection

我能够获得与备份服务器的 ssh 连接,但无法复制任何文件。指出我可以做的事情并将文件复制到备份服务器。提前致谢。

我发现我可以将最大 4k 大小的文件/文件夹复制到备份服务器,但不能复制更大的文件。当我尝试将大文件复制到另一台服务器但不在备份服务器上时,它正在工作。

标签: linuxnetworkingsshubuntu-16.04scp

解决方案


看来我通过将 LAN 卡的 mtu 设置为 1492 找到了解决方法

# ifconfig eth0 mtu 1492

有关更多信息,请参阅此链接:http: //www.microhowto.info/howto/change_the_mtu_of_a_network_interface.html


推荐阅读