Skip to main content
  1. Posts/

OVH VPS SSH Broken Pipe (Timeout): How to keep alive

·163 words·1 min· loading · loading · ·
Marco Mornati
Author
Marco Mornati
I build, self-host and sometimes break software in production — writing about AI tooling, coding agents and infrastructure.

Introduction
#

I recently noticed that on my OVH VPS Server, SSH sessions hang up with Write failed: Broken pipe message after a while when I leave them unused for about 30 seconds. This means you will need to reconnect once again, keeping all SSH/bash processes alive (waste of memory!).

I think there’s a proxy between me and my server that kills idle connections.

Client Configuration
#

To solve this problem you can change settings on the client by adding the ServerAliveInterval property to your SSH config file. If you are on Linux or Mac client, you need to edit ssh_config:

sudo vi /etc/ssh_config

Append to the end of file:

ServerAliveInterval 30

which means your client sends a handshake message every 30 seconds to the server.

If you have a windows client you can set the KeepAlive like in the following screenshot:

keepAlive

Verification
#

Now all your ssh connection should be kept active even if you leave your computer for a coffe ;)