Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu scp上的断管错误_Ubuntu_Ssh - Fatal编程技术网

Ubuntu scp上的断管错误

Ubuntu scp上的断管错误,ubuntu,ssh,Ubuntu,Ssh,我可以很好地用ssh连接到我的ubuntu盒中,我已经在服务器上安装了一个版本的应用程序,但是当我运行的时候 scp MaryBaked.tar.gzroot@marybakedpdx.com:/home/marybakedpddx 甚至 scp MaryBaked.tar.gzroot@marybakedpdx.com:~ scp的进度跳到了81%,然后进程说stalled,我得到了 rite失败:管道破裂 断开连接 编辑 root@marybakedpdx:/home/marybakedpd

我可以很好地用ssh连接到我的ubuntu盒中,我已经在服务器上安装了一个版本的应用程序,但是当我运行的时候

scp MaryBaked.tar.gzroot@marybakedpdx.com:/home/marybakedpddx

甚至

scp MaryBaked.tar.gzroot@marybakedpdx.com:~

scp的进度跳到了81%,然后进程说
stalled
,我得到了

rite失败:管道破裂 断开连接

编辑

root@marybakedpdx:/home/marybakedpdx#df-T


尝试节流-
2Mb/sec最大吞吐量
如下:

scp -l 2000 MaryBaked.tar.gz root@marybakedpdx.com:/home/marybakedpdx

问题在于连接关闭,可能是因为文件太大,会话因超时而终止

解决方案1:使用ServerAliveCountMaxServerAliveInterval选项,从保持会话的服务器(ACK)来回发送保持活动状态的消息

scp -o ServerAliveInterval=15 -o ServerAliveCountMax=3 <yourIP>:~
scp-o ServerAliveInterval=15-o ServerAliveCountMax=3:~
在本例中,每15秒查看一次ACK,如果45秒内有3次ACK(15*3)没有返回,则关闭会话

请参阅以下属性文档:

ServerAliveCountMax 设置在ssh(1)没有接收到来自服务器的任何消息的情况下可以发送的服务器活动消息数(见下文)。如果在发送服务器活动消息时达到此阈值,ssh将断开与服务器的连接,从而终止会话。需要注意的是,服务器活动消息的使用与 TCPKeepAlive(如下)。服务器活动消息通过加密通道发送,因此不会被欺骗。TCP协议 TCPKeepAlive启用的keepalive选项是伪造的。服务器 当客户机或服务器依赖于 知道连接何时变得无响应。默认值 是3。例如,如果ServerAliveInterval(见下文)设置为15 如果服务器变为 如果没有响应,ssh将在大约45秒后断开连接

ServerAliveInterval设置超时间隔(以秒为单位),在此之后,如果 没有从服务器接收到数据,ssh(1)将发送一条消息 通过加密通道从服务器请求响应。 默认值为0,表示这些消息不会发送到 服务器

解决方案2: 我可以建议您一个简单的解决方法:压缩文件,发送并在目标计算机中提取。这将缩短连接时间,并应解决超时问题

gzip bigfile.bin
scp bigfile.bin.gz <destinationIp>:~/
ssh -At <destinationIp>
cd ~
gunzip bigfile.bin.gz
gzip bigfile.bin
scp bigfile.bin.gz:~/
ssh-At
光盘~
gunzip bigfile.bin.gz

每次都是81%吗?是77%还是81%?你能把
df-T
的输出放入你的问题中吗。我怀疑可能是磁盘空间不足。上面添加了..正在进行格式化请看这里:
gzip bigfile.bin
scp bigfile.bin.gz <destinationIp>:~/
ssh -At <destinationIp>
cd ~
gunzip bigfile.bin.gz