Build running via VSTS build agent cannot connect to Mac via SSH

JohnDBJohnDB USMember ✭✭

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.

(https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/)

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.

Best Answer

  • JohnDBJohnDB USMember ✭✭
    edited October 23 Accepted Answer

    Thanks for the suggestion. I did look at that and there were no entries related to permissions. I've since corrected the problem. I think it boiled down to local network/config issue that I just couldn't isolate, so not a VSTS agent fault, more to do with our specific setup. I did a full reset/install and that has corrected the problem.

Answers

  • JGoldbergerJGoldberger USXamarin Team, University Xamurai

    Did you try to output the SSH log to get ore details as noted in the trouble shooting guide, 2nd bullet point, here: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/#Unable_to_connect_to_Address192.168.1.222_with_Usermacuser

    Run the following command in terminal after a failed connection attempt:

    grep sshd /var/log/system.log > "$HOME/Desktop/sshd.log
    

    Then inspect the sshd.log file on your desktop for any more details about what ,ay be going on.

    It may also be worht trying what is in bullet point 1 in the link above, i.e. delete id_rsa and id_rsa.pub from %LOCALAPPDATA%\Xamarin\MonoTouch, and then reconnect to the Mac build host.

  • JohnDBJohnDB USMember ✭✭
    edited October 23 Accepted Answer

    Thanks for the suggestion. I did look at that and there were no entries related to permissions. I've since corrected the problem. I think it boiled down to local network/config issue that I just couldn't isolate, so not a VSTS agent fault, more to do with our specific setup. I did a full reset/install and that has corrected the problem.

Sign In or Register to comment.