@miecool Are you connecting in the local area network or through remote access? We can first find out whether it is a network problem. In addition, you can use ssh -vvv to investigate the cause of the disconnection.
Have you tried to perform ssh -vvv to investigate the reason why ssh is disconnected? In fact, I’m a little suspicious that the remote connection is not stable. What remote connection scheme do you use?