ssh fails with ssh_dispatch_run_fatal invalid format During the last years I've had various problems with MacOS SSH, but those were quickly resolved searching the net. This is now something different.    

This is Mojave -system with lates updates (10.14.4). I do think though that this did begin even before updating with the latest patches.

$ ssh -V
OpenSSH_7.9p1, LibreSSL 2.7.3


The error I get is:

$ ssh &lt;host&gt; -v
---8&lt;----
debug1: no key from blob. pkalg ssh-rsa: invalid format
ssh_dispatch_run_fatal: Connection to &lt;host&gt; port 22: invalid format


I've tried running without defined config-file, running with different options, but with no help.  From other systems, such as Arch Linux (OpenSSH_7.9p1) and CentOS7 (OpenSSH_7.4p1) ssh'ing to the same host works well. Especially the same SSH version working on an arch linux tells me that this is something apple-related.

So what is happening now and how to fix this behaviour?
It may be that your keys are corrupted, as this issue is seen after some hardware failures. Try backing up and removing /etc/ssh/ssh_host_* and generating the missing keys with ssh-keygen -A.