Fix SSH Error in Terminal & Linux: client_loop: send disconnect: Broken pipe

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

A common problem encountered by server administrators or those who make connections via SSH via Terminal or Putty, is the sudden disconnection from the session with the message: client_loop: send disconnect: Broken pipe .
Most of the time, this logout message appears after a period in which no command line has been executed in the SSH session. Many prefer to remember from time to time the open session and give another "Enter”Or a“ w ”to keep the session open. A better solution is for this sudden closing of the session after an "idle" period to stop.

How to prevent the sudden end of an SSH session with “client_loop: send disconnect: Broken pipe” in Terminal (Linux / Mac) 

For both Linux and Mac, a line will be added in the SSH configuration. We open and edit the file “ssh_config”.

sudo nano /etc/ssh/ssh_config

We add the line:

Host *
ServerAliveInterval 120

Save and close the file "ssh_config". If we are on Linux we will have to restart the "sshd" service.

directive ServerAliveInterval will send a null packet to the server at 120-second intervals to keep the session alive and thus prevent it from closing abruptly.

Fix SSH Error in Terminal & Linux: client_loop: send disconnect: Broken pipe

About the author


Passionate about everything gadget and IT, I write with pleasure on since 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.


Leave a Reply to Jack Ostroff X