Once in a while when I do ssh $USER@$REMOTE_HOST_NAME
I get the following error
mux_client_request_session: read from master failed: Broken pipe
What does it mean? I have Ubuntu desktop and Debian 10 server. How can I trace it down?
Once in a while when I do ssh $USER@$REMOTE_HOST_NAME
I get the following error
mux_client_request_session: read from master failed: Broken pipe
What does it mean? I have Ubuntu desktop and Debian 10 server. How can I trace it down?
Do you have ControlPersist
enabled in your ~/.ssh/config
file? If so, there is no solution other than removing ControlPersist
.
From the https://man.openbsd.org/ssh_config:
When used in conjunction with ControlMaster, specifies that the master connection should remain open in the background (waiting for future client connections) after the initial client connection has been closed. If set to no (the default), then the master connection will not be placed into the background, and will close as soon as the initial client connection is closed. If set to yes or 0, then the master connection will remain in the background indefinitely (until killed or closed via a mechanism such as the “ssh -O exit”). If set to a time in seconds, or a time in any of the formats documented in sshd_config(5), then the backgrounded master connection will automatically terminate after it has remained idle (with no client connections) for the specified time.
Host *
IdentitiesOnly yes
ControlPath ~/.ssh/logincontrol/%r@%h:%p
ControlMaster auto
ControlPersist yes
Take a look at:
https://www.cyberciti.biz/faq/linux-unix-reuse-openssh-connection/
ssh $USER@$REMOTE_HOST_NAME
from Linux or Unix terminal.ssh $USER@$REMOTE_HOST_NAME
again after a network problem, the ssh tries to reuse the connection from step 1, and opens a new connection after a timeout. Hence, you get that error.Either remove ControlPersist
option from ~/.ssh/config
file or ignore it as the network problem is beyond your control. There is no other option.
Pass the -v
option and it will give you much needed debug information:
ssh -v user@somewhere
ssh -vv user@somewhere
OMG. I never think ssh_config. I added it 6 months back and when my Internet goes down then only it happens. Also ssh -v
is cool trick.