We've been successfully running builds via VSTS for a long time now. Some of our builds compile iOS, Android and UWP so run on a windows box, with the iOS portion delegating to a mac (we use the ServerAddress, ServerUser and ServerPassword parameters for MsBuild to do this). Until recently this has worked perfectly, but now we are getting SSH errors during the iOS portion of the build.
##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,5): Warning : Could not authenticate the user 'xxxxxx' with SSH keys. Please check that both $HOME folder and ~/.ssh/authorized_keys have the appropiate permissions to use SSH. More details: Permission denied (publickey). (I've redacted the user name).
I've been through the connection troubleshooting guide (checking permissions on $HOME/.ssh/authorized_keys for example) with no luck.
Interestingly I can successfully run the build from VS2017 and the command line on the windows box and there is no problem with the connection to the mac and the build succeeds, so it's only when the build runs via the agent that the connection fails.
I've also tried changing the account under which the agent runs, but nothing I have tried has solved the problem.
We are running all the latest versions of Visual Studio for Mac (7.2 stable), Visual Studio 2017 (15.4.1) and the VSTS agent, so I am at a bit of a loss as to how to fix the problem. Any help/suggestions would be appreciated.