Error: untrusted X11 forwarding setup failed

I finally ironed out all of the issues with my KVM server, and to eliminate any of the left over junk, for lack of a better phrase, I nuked the server and reinstalled Ubuntu 20.04. For the record, junk consisted of various packages, their configurations, and system modifications, that I'd tried out in deciding how to configure/adminster my KVM server.

My kvm volume group still existed, so from the KVM perspective, I didn't lose anything, which would have been the hardest part to recreate.

At the same time, I upgrade my iMac from 11.2 --> 11.5.1, which are both Big Sur releases.

Once I tried to log into my kvm server, I got this message:

Warning: untrusted X11 forwarding setup failed: xauth key data not generated

Lots of Google hits, but none seemed to work.

Debugging ssh (ssh -vv tom@<KVM IP>), I got some additional information:

debug1: No xauth program.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated

Doing some research, the debug1: No xauth program. error was on my iMac, which just reported that the iMac couldn't find the xauth program.

which xauth
/opt/X11/bin/xauth

It should be as easy as putting XAuthLocation /opt/X11/bin/xauth in the /etc/sshd/sshd.config file and restarting sshd, but that didn't work.

Even tried rebooting (Microsoft troubleshooting), just in case OSX doesn't read the config when restarting . . . . still nothing.

Finally got it to work by putting XAuthLocation /opt/X11/bin/xauth in my ~/.ssh/config file.

Once it was in the ~/.ssh/config file, errors no longer occurred, and I was able to forward the X server.