Fix SSH client_loop: send disconnect: Broken pipe

This tutorial solves the problem of sudden disconnection SSH in Linux Client_loop: Send Disconnect: Broken Pipe.

The safest connection to a remote server is through a SSH cryptographic network protocol (Secure Shell).

A problem commonly encountered by server administrators or those who make connections through SSH via Terminal or Putty, is the sudden disconnection of the session with the message: client_loop: send disconnect: Broken pipe.

Most of the time, this disconnection message appears after a period in which no command line has been executed in the session SSH. Many prefer to remember from time to time when the session open and give more “Enter” or a “w” for the session to remain open. A better solution is that this sudden closure of the session after a period of “idle” to have no place.

How to prevent the sudden completion of a SSH session with the Customer_loop Error: Send Disconnect: Broken Pipe in Terminal (Linux / Mac)

Both for Linux and for Mac, a line will be added to the SSH configuration. We open and edit the file ssh_config.

sudo nano /etc/ssh/ssh_config

We add the line:

Host *
ServerAliveInterval 120

We save and close the file “ssh_config“. If we are on Linux we will have to restart the service “sshd”.

Related: Prevent SSH Connection Timing Out / Broken Pipe

Directive ServerAliveInterval It will send at 120 -second intervals a null package to the server to maintain the session in life and thus will prevent its sudden closure.

Passionate about technology, I write with pleasure on stealthsetts.com starting with 2006. I have a rich experience in operating systems: Macos, Windows and Linux, but also in programming languages ​​and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, Presashop).

Home » Your source of IT tutorials, useful tips and news. » Fix SSH client_loop: send disconnect: Broken pipe

3 thoughts on “Fix SSH client_loop: send disconnect: Broken pipe”

Leave a Comment