ERROR: Secsh channel open FAILED: Connect failed

Posted by in SSH, last updated on 30 April, 2020

The issue

I recently ran into the following error when trying to deploy remotely using docker-compose:

ERROR: Secsh channel 14 open FAILED: open failed: Connect failed

The issue is that the default SSH connections allowed is set to 10 and the command I was running was trying to use more connections then that.

Fixing the error

To fix this error you’ll need to connect to your server via SSH and edit the /etc/sshd_config file. Find the MaxSessions line and uncomment it. The default is 10 as mentioned, I set mine to 20 instead:

MaxSessions 20

Then restart the ssh service:

sudo service ssh restart

After that I could run my command successfully, hope this helps you as well!

Daniel Wachtel

Written by Daniel Wachtel

Daniel is a Full Stack Engineer who outside work hours is usually found working on side projects or blogging about the Software Engineering world.