Unable to connect to Xamarin Mac Agent

Hi Guys,
I am unable to connect to Visual Studio Mac machine from my Visual Studio IDE. I was able to connect it once but then again started getting the same error as follows in the log :

Xamarin.Messaging.Ssh.MessagingService|Information|0|Starting connection to Mac 192.168.10.39... Xamarin.VisualStudio.Remote.State.DisconnectedState|Error|0|Unable to authenticate with SSH keys. Please try to log in with credentials first Xamarin.Messaging.Ssh.Exceptions.MessagingAuthenticationException: Could not authenticate the user 'radamatic' 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). ---> Renci.SshNet.Common.SshAuthenticationException: Permission denied (publickey).

Following things i have tried doing :

  • Deleting cache xamarin folder - XAM from both iOS & Windows.
  • Installing the stable versions of Xamarin on both the machines.

But none of above fixed the issue. Just to let you know that i am able to access my Mac machine using Putty software on 22 port SSH. So, this means everything is right on the network front.

Please have a look at the Logs.zip file enclosed to guide me where things are going wrong.

Thanks in advance!

Tarun

Best Answer

  • TarunOhriTarunOhri US ✭✭
    Accepted Answer

    Hi Guys,

    I found the solution to it. Just thought to share with you.
    There are few things we need to keep in mind :

    • Both the machines must be under same internet connection.
    • Connecting to mac machine via Xamarin Mac Agent has nothing to do with the versions of Xamarin installed in your Mac & Windows machine. The version miss-match comes into picture at the time of deploying your project. So, just be focused on connecting to machine first. Once that is done, we will update Xamarin on both the machines to "Stable" version.
    • So, we were able to access the Mac machine via Putty, which means there is no network issue. Must be something related to Xamarin, right ? When we try to log in Xamarin Mac Agent, it authenticate the user and attempt to write some certificate file on the Mac machine..So, the problem is... By default... Mac doesn't allow to write a file from a remote machine. So, we need to enable it.
    • Steps : Type the following command in your terminal of Mac Machine :
      sudo chmod -R 755 ./
      ls -l .ssh

    That's it :) Now try logging in Xamarin Mac Agent from windows machine.

    Happy Coding !!

Answers

  • TarunOhriTarunOhri USMember ✭✭
    Accepted Answer

    Hi Guys,

    I found the solution to it. Just thought to share with you.
    There are few things we need to keep in mind :

    • Both the machines must be under same internet connection.
    • Connecting to mac machine via Xamarin Mac Agent has nothing to do with the versions of Xamarin installed in your Mac & Windows machine. The version miss-match comes into picture at the time of deploying your project. So, just be focused on connecting to machine first. Once that is done, we will update Xamarin on both the machines to "Stable" version.
    • So, we were able to access the Mac machine via Putty, which means there is no network issue. Must be something related to Xamarin, right ? When we try to log in Xamarin Mac Agent, it authenticate the user and attempt to write some certificate file on the Mac machine..So, the problem is... By default... Mac doesn't allow to write a file from a remote machine. So, we need to enable it.
    • Steps : Type the following command in your terminal of Mac Machine :
      sudo chmod -R 755 ./
      ls -l .ssh

    That's it :) Now try logging in Xamarin Mac Agent from windows machine.

    Happy Coding !!

Sign In or Register to comment.