tl;dr If you use macOS and there are spaces in the path to (or name of) the Mathematica app, remove those spaces!
I believe that this error is shown when the process started by the Front End (that is supposed to eventually launch the kernel) exits, and no kernel has connected back to the Front End.
If you see the error immediately after trying to start up the kernel, then the problem is very likely not with the network connection between the Front End and the Kernel computers, and the advice in @Karolis's answer will not work.
One problem could be that the Front End is unable to launch the ssh program to connect to the remote machine. This is exactly what happens on macOS when there are spaces in the path to the Mathematica app. For example, I have several versions of Mathematica installed, and they are named similarly to
If you go into the kernel configuration options, and set it to advanced mode, you will see a launch command starting with
`java` -jar "`wolframssh`" user@host ...
The special templates
`wolframssh` expand to paths like
and in the process, something goes wrong with the quoting or escaping of the spaces in the paths.
To fix this, either eliminate the spaces, or manually enter the paths. E.g., if you already have Java installed,
java "/Applications/Mathematica 11.2.app/Contents/SystemFiles/Java/WolframSSH.jar" user@host ...
will be fine. If you use public key authentication and do not need to type a password to connect, then you may use the system's
ssh instead of Wolfram's:
ssh user@host ...