Lee14 wrote:
BTW, when it ceases to respond to ssh, it won't even ping. Packets time out.
That's more than ssh, that's most likely network-level error.
Maybe a routing problem or a bad or misconfigured default route. Could be a failing network device, or misconfigured subnets, for instance. Could also be a more fundamental problem with the hardware or software in use here, too.
Are there any add-on anti-malware or add-on security tools around? If so, disable and/or remove those per the vendor instructions, and reboot through Safe Mode to flush and rebuild caches, and try again.
Is more than one network controller active on this iMac? Wired and Wi-Fi for instance? If so, is the Wi-Fi running as access points, or are there multiple IP subnets configured?
If Wi-Fi, see if migrating to a wired networking connection works more reliably. Wi-Fi networks can be harder to troubleshoot, and subject to interference.
Are you running macOS Server (the community where this question was posted), or is this High Sierra without Server.app around? Server can add a few wrinkles, such as DNS configuration errors.