Weird password thing.... thoughts?

I have an iMac, MacBook Air, iPad, iPhone. On the iMac only, I keep getting asked to log into iCloud & getting a message that “This Mac can’t connect to iCloud because of a problem wit "myemailaddress@mac.com”. No problem on the Mac Book Pro, no issue on the iPhone or iPad, can log into iCloud.com on the iMac. I fear it is a virus, more than anything else… Don’t really want to do account recovery when I can login happily on every other device/location. Any wisdom, team?
OS 10.13.6

I googled

This Mac can’t connect to iCloud because of a problem

and this possibly useful article was the first of many results. Best of luck.

I’m getting my exact same issue, but ONLY when trying to log into iMessage on my Mac. Just randomly stopped working. Bizarre

I’ve had that problem in recent months. It appears it was caused when the laptop had a kernal panic (unrelated to iCloud) and shut down abnormally. Probably created an issue with iCloud settings.

The resolution suggested by Apple Support was to completely log out of iCloud on my MacBookPro, reboot, and log back in. This kicks off a chain of time-consuming synchronizations, the need to log back into iCloud on some apps, etc. Took about an hour to get things back to normal.