The message sometimes appear when transferring files using scp.
In order to solve this, you need to edit “/etc/sshd_config” file and change or add this line:
UsePrivilegeSeparation yes
Then restart OpenSSH server. This will solve the kex protocol error problem,