centos - scp 上传后挂起

标签 centos scp hyper-v

设置:

当我们在 CentOS Hyper-V VM 上使用 SCP 将文件复制到目标 (SunOS) 时,它会达到 100%,然后挂起,而不是关闭连接。当我们最终使用 ctrl+C退出,远端文件为空。

整个过程在非常小的文件上运行良好,但如果是几十行,它就会开始挂起。

CentOS 机器使用默认开关。
SSH在 CentOS 虚拟机上运行良好。

来源 : 在 Hyper-V (Windows 10 Ent.) 上运行的 CentOS 7.6 VM

目的地 : SunOS 5.6 x64 机器

日志:

scp -vvv tst.txt user@target.domain:/tmp/
...
debug1: Sending command: scp -v -t /tmp/
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 4
debug1: Remote: Missing locale support for LANG=en_US.UTF-8
debug2: channel 0: rcvd adjust 201600
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Sending file modes: C0664 12840 test.txt
test.txt                                                     100%   13KB   0.1KB/s   02:52

追踪 :

相关部分是以下 block ,当文件具有任何显着大小时,它会无限循环:
write(1, "\rtest.txt                       "..., 185) = 185
rt_sigaction(SIGALRM, NULL, {0x555900a4ebf0, [], SA_RESTORER|SA_INTERRUPT, 0x7fc354919280}, 8) = 0
alarm(1)                                = 0
rt_sigreturn({mask=[]})                 = -1 EINTR (Interrupted system call)
read(7, 0x7ffe718fdb0f, 1)              = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---```

最佳答案

在我的情况下,通过 OpenVPN 连接时 MTU 存在问题。我在 OpenVPN 配置文件中添加:
mssfix 1200
现在一切正常。转移不再以 100% 挂起。

关于centos - scp 上传后挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54894837/

相关文章:

windows-10 - 如何让 Vagrant Homestead 使用 Hyper-V 启动

android - 在 Windows 10 上为 Android Studio 安装 HAXM

Java 和 Hyper-V

linux - CentOS 6.4 logrotate 显示错误权限被拒绝

database - Repmgr 无法在 claster 中注册备用,我错过了什么?

ubuntu - 无法连接到比格犬骨黑

linux - scp 或 pscp 将文件传输到 ssh 计算机,但不显示计算机中的任何复制文件

ansible - 如何在环境变量 Ansible Playbook 中使用命令

centos - rpm 签名验证在 CentOS 上失败,在 Fedora 上有效

Phpseclib:部分文件下载