[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Bulk] Re: ssh error - Write failed: Broken pipe



On 24/05/12 04:24 AM, elbbit wrote:
On 23/05/12 22:45, Gary Dale wrote:
On 23/05/12 04:53 PM, elbbit wrote:
On your server put this line in your sshd_config after "Port 22":

Port 443

Do a "service ssh restart" or "/etc/init.d/ssh restart".  Connect using:

ssh -p 443 user@host

That has the same issue as the keepalive - it presumes that the
connection is at fault when the problem only seems to happen when I'm
doing large amounts of data movement on the server (NOT over the
connection).
Are you saying that if you log in by SSH then issue a command like

cp large_file4gb large_copy4gb

that even though the command produces no output you then get broken
pipe?  If so the connection is likely being terminated because it's idle
(check your internet provider).  The keepalive should prevent this.

If you log in and do a

ls -R /

do you get the output or broken pipe?  If you get broken pipe before the
command completes this again suggests (to me) that you are subject to
packet inspection.

For me, putting sshd on different ports helps here like ports 22, 81,
443, 2022, 3389 and 20222.  Some 3G providers here (UK) block port 22
altogether. One works best on port 81, on others 443 seems to work most
of the time.  Some network admins prefer to administer Windows boxes and
(thus) leave port 3389 untouched. YMMV.

Either way, in my experience broken pipe is usually a network problem.

Fascinating. The keep-alive seems to prevent the error, which is occurring at the end of whatever command I executed on the server. This would be when the remote shell is returning to the command prompt.

For example, if I mount usb drive on the remote server then copy some files to it, the pipe breaks after the copy completes. If I put the sequence in a script, complete it with a umount command at the end, the copy completes and the device is not mounted when the pipe breaks.

This would suggest that it's the sending of data (the shell prompt) from the remote machine that is triggering the broken pipe. This is confirmed because I can leave the remote session sitting for hours before coming back to enter another command without problems. It's just when it's the remote server initiating data transfer after an extended period of inactivity that I get a broken pipe.

Clearly the keep-alive is helping by preventing an extended period of inactivity.

However, I'm puzzled by why the timeout only seems to operate against the server and not against my workstation. The remote servers are running Squeeze in all cases, while my workstation is running Wheezy. Has something changed between the two releases?


Reply to: