Linux – Write failed: Broken pipe (in Ubuntu 10.04)

linuxsshUbuntu

I have the broken-pipe problem while using ssh to another Linux server (after idling for about 5-10 mins):

Write failed: Broken pipe

Interestingly, I started to have this problem after upgrading my computer to Ubuntu 10.04, while the Linux server remains unchanged. I also tried to ssh from an OpenSUSE 11.2 machine, and it doesn't have any problem …

Any clue?

Best Answer

I think it could be a case of routers/firewalls/etc forcibly disconnecting your idle sessions.

Try using a 'keepalive' when you connect

ssh -o TCPKeepAlive=yes

Note: there's definitely several other ways to set up keepalives on an ssh connection, server side or client side. Above is a straightforward client-side one.

hth