ssh fails with ssh_dispatch_run_fatal invalid format
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.