Bug 49113 - [XMA] Xamarin Mac Agent Login Disabled
Summary: [XMA] Xamarin Mac Agent Login Disabled
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: mwg@thoughts.net
URL:
Depends on:
Blocks:
 
Reported: 2016-12-06 17:23 UTC by mwg@thoughts.net
Modified: 2017-01-30 21:36 UTC (History)
8 users (show)

Tags: xma
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description mwg@thoughts.net 2016-12-06 17:23:34 UTC
When attempting to connect with Mac Agent via popup, even though username and password are supplied, "Login" button is disabled. "Cancel" button is active. Attempting to add new Mac Agent results in same scenario when reaching "Login" popup.

Also unable to "Forget this Agent" by right click on existing Agent in dialog; context menu selection disabled.

Using VS Enterprise 2015 Update 3 with Xamarin Forms v2.3.3.8.
Comment 1 mag@xamarin.com 2016-12-20 13:57:08 UTC
Hi.

The reason why the "Forget" button could be disabled is that the machine that you are trying to connect is not a "known" host. By "known" host I mean a machine where you connected at least once. Also, the reason why you are seeing the machine is because the Bonjour Service has discovered it in the network. That said, if you can connect once, then the machine will be saved and the next time you see the dialog, you will be able to "Forget" it.

Related to the "Login" button disabled, it could be that the Mac is nor retrieving it's SSH fingerprint. To verify that, It would be good if you can attach the VS log. You can get it from here: %LOCALAPPDATA%\Xamarin\Logs\<VSVersion>\Ide.log.
Please get the log that correspond to the VS instance that you are using on the repro.

Additionally, you can verify if the Mac has the SSH daemon started. To start it, you need to enable "Remote Login" under System Preferences > Sharing.

Finally, as an extra check you can try connecting via SSH to the Mac with Putty from Windows. If you can't connect, then you are missing something on the Mac.

You can check the Connection Troubleshooting guide for more information: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/
Comment 2 mwg@thoughts.net 2017-01-03 14:36:43 UTC
Ok. Back to resolving this issue. In the log I found:

Xamarin.VisualStudio.IOS.Bonjour.BonjourDiscovery Information: 0 : [2017-01-03 09:21:39.9853] Bonjour service 'mac' did not respond with its IP address.
Xamarin.VisualStudio.IOS.MacServer Error: 0 : [2017-01-03 09:24:45.0595] Could not retrieve fingerprint.
System.OperationCanceledException: Could not retrieve fingerprint. ---> Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.

The Mac Agent sees the mac. I even change the name of the mac and VS saw the change. I does show that Remote Login is enabled.

I have PuTTy but I am not sure how to use it to perform the suggested test.

Is there a config file I can delete or modify to force re-initialization of the connection?
Comment 3 mag@xamarin.com 2017-01-03 16:40:23 UTC
Thanks for your response.

Based on what you say, what is happening is that the Bonjour Service is working fine (that's why you see the reflected Mac name changes in the Server Selector dialog), but something is not right with the SSH configuration on your Mac.

VS is just a client of the Xamarin Mac Agent, so it tries to connect to the Mac and start everything that it needs to work. The first connection that it performs is via SSH, to establish a secure tunnel to send and receive information, and that's the step on which you are getting stuck.

For that reason, you don't need to force re-initialization of the connection, because you are not being able to even establish the first SSH handshake between Windows and Mac.

Unfortunately, we need to try to connect with an SSH client outside VS to determine if the problem is on your Mac SSH configuration or if there is something else on VS and Xamarin side that could be affecting the connection.

So, if you have Putty installed, it's pretty simple to connect via SSH to your Mac. Just open Putty and do this:

1 - Once Putty is opened, go to the left panel of the window and click on Session category
2 - Now, on the Host Name (or IP address) checkbox, put exactly the same host name or IP that you can see in the Server Selector dialog in VS when you try to connect to the Mac (you can try two times, one with the IP address and on with the host name)
3 - Ensure that the Connection type radio button is with SSH option selected
4 - Let the Port value in 22 (default SSH port)
5 - Click on the 'Open' button

If everything is okay with you Mac SSH configuration, a command prompt will ask you for credentials (enter the same credentials that you enter on Visual Studio when trying to connect), and see if you get authenticated and with access to the Mac via SSH

If you encounter any issue while connecting with Putty, this means that something is wrong in your Mac, for which I strongly recommend to follow step by step Xamarin guide to configure your Mac and also to troubleshoot any connection issue: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/

Feel free to ask us through this bug if you have any issue with the items or information of the mentioned guide.

For now, I change the status of the bug to NEEDINFO, since there is not much more to do until we can figure out  what you are missing on the Mac side.
Comment 4 mwg@thoughts.net 2017-01-04 01:28:12 UTC
Using Putty, both the local DNS and actual address, receiving "Network error: Software caused connection abort". 

Verified the MAC settings. The firewall is off and Remote Login is enabled (red button) using a specified username, mine. Rebooted MAC.

Retested with Putty with same results "Network error: Software caused connection abort". PortQry shows the port at the address is listening.
Comment 5 mwg@thoughts.net 2017-01-04 01:35:39 UTC
Attempting to add new Mac Agent, log shows

Xamarin.VisualStudio.IOS.MacServer Error: 0 : [2017-01-03 20:26:16.7291] Could not retrieve fingerprint.
System.OperationCanceledException: Could not retrieve fingerprint. --->
Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.
   at Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at Renci.SshNet.Session.SocketReadLine(TimeSpan timeout)
   at Renci.SshNet.Session.Connect()
   at Renci.SshNet.BaseClient.Connect()
   at Xamarin.Messaging.Client.Ssh.SshFingerprintRetriever.<>c__DisplayClass1_0.<RetrieveFingerprintAsync>b__1()
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.Ssh.SshFingerprintRetriever.<RetrieveFingerprintAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.IOS.Messaging.FingerprintRetriever.<RetrieveFingerprintAsync>d__2.MoveNext() in C:\data\lanes\3513\27a9b40a\source\xamarinvs\src\Core\VisualStudio.IOS\Messaging\FingerprintRetriever.cs:line 20
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.IOS.MacServer.<AskForCredentialsAsync>d__53.MoveNext() in C:\data\lanes\3513\27a9b40a\source\xamarinvs\src\Core\VisualStudio.IOS\Messaging\MacServer.cs:line 363
Comment 6 mag@xamarin.com 2017-01-04 12:40:51 UTC
Thanks. So, we can confirm that something is wrong with your Mac SSH configuration, non related to Xamarin.

I didn't understand what did you mean by red button in this phrase: "The firewall is off and Remote Login is enabled (red button) using a specified username, mine". If in the Sharing window, instead of a green dot near "Remote Login: On" you see something else, then it means that the SSH server and the Remote Login feature can't be enabled because of something else (network config, sshd config file, etc)

Can you please attach a screencast or screenshot of what you see on the Mac, so I can follow it better?

Also, here is a screenshot of how it should look if everything is okay, and also how you can check in the Mac via terminal if SSH server is up and running: "ssh localhost" in a Terminal.

See screencast: http://screencast.com/t/2YEj4TUsVcMm
Comment 7 mwg@thoughts.net 2017-01-18 16:26:29 UTC
I have follow the steps in the screencast with positive results. Sharing indicates Remote Login in "On". When I initially connected, a key was applied, but subsequently, Terminal has not shown the same message.

However, the VS Mac Agent doesn't find a SSH fingerprint when attempting to connect to the Mac mini in use. After the dialog pop appears, although I supply my Mac UserID and password, the login button is still disabled. I have used both VS 2015 and VS 2017 RC with the same results in attempting to connect.
Comment 8 mwg@thoughts.net 2017-01-18 16:30:04 UTC
Because of issues with VS 2017 and Xamarin in this cross platform solution, I am removing VS 2017 at this time and reverting back to VS 2015
Comment 9 mwg@thoughts.net 2017-01-19 21:21:44 UTC
I followed your recommendations with no positive results. From the VS side I found the following log entry. How should I proceed?

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>0</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2017-01-19T19:57:23.0502125Z" />
<Source Name="Xamarin.VisualStudio.IOS.MacServer" />
<Correlation ActivityID="{5b905a10-98e8-4f8c-989c-b33dba4280d7}" />
<Execution ProcessName="devenv" ProcessID="10000" ThreadID="43" />
<Channel />
<Computer>EXTREME</Computer>
</System>
<ApplicationData>Could not retrieve fingerprint.
System.OperationCanceledException: Could not retrieve fingerprint. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
   at Renci.SshNet.Abstractions.SocketAbstraction.Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)
   at Renci.SshNet.Session.SocketConnect(String host, Int32 port)
   at Renci.SshNet.Session.Connect()
   at Renci.SshNet.BaseClient.Connect()
   at Xamarin.Messaging.Client.Ssh.SshFingerprintRetriever.<>c__DisplayClass1_0.<RetrieveFingerprintAsync>b__1()
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.Ssh.SshFingerprintRetriever.<RetrieveFingerprintAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.IOS.Messaging.FingerprintRetriever.<RetrieveFingerprintAsync>d__2.MoveNext() in C:\data\lanes\3513\00fa5cc4\source\xamarinvs\src\Core\VisualStudio.IOS\Messaging\FingerprintRetriever.cs:line 20
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.IOS.MacServer.<AskForCredentialsAsync>d__53.MoveNext() in C:\data\lanes\3513\00fa5cc4\source\xamarinvs\src\Core\VisualStudio.IOS\Messaging\MacServer.cs:line 363</ApplicationData>
</E2ETraceEvent>
Comment 10 mag@xamarin.com 2017-01-19 21:46:34 UTC
Hi,

As I mentioned before, your issue seems unrelated to Xamarin, since your Mac is being unaccessible via SSH, not only with Xamarin, but also with Putty and I suppose with any other SSH client.

However, we would like to help you to unlock your problem, but with the comments that you provide I can't figure out what could be happening with the configuration of your machine.

First of all, I didn't understand what you meant with: "I have follow the steps in the screencast with positive results. Sharing indicates Remote Login in "On". When I initially connected, a key was applied, but subsequently, Terminal has not shown the same message."

You are not being very clear about which message the Mac is showing and what you are doing. It would be really really helpful if you can record a screencast of how the SSH config (remote login option, /private/etc/ssh/sshd_config file, etc) looks like and also the connection test with the Mac terminal. You could give it a try with Jing software (https://www.techsmith.com/jing.html), which is free and lightweight and you can record a screencast video and share the link in this bug as I did previously.

Please give it a try and put special attention to the sshd_config file, which has the SSH server configuration.

Sorry but without more details, I can't figure out what is going on with this machine. I gave you the basic troubleshooting for SSH configuration in the Mac, which should fix most of the issues.

Thanks,
Mauro
Comment 11 mag@xamarin.com 2017-01-19 21:49:26 UTC
One more thing, that I was always assuming but never asked directly... at the time of connecting with VS or Putty, are you having your Mac logged in with the same user that you are trying to connect from the client right? That is a mandatory requirement to get the things working.

Thanks,
Mauro
Comment 12 mag@xamarin.com 2017-01-20 12:30:09 UTC
Hi again,

I don't know if you could take a look at the connection troubleshooting guide that I pointed to you in Comment 1, but there is a known issue that could happen in machines where the DNS lookup setting for SSH is enabled.

The DNS lookup uses Internet to search the resolved client machine name and compare the IP address as an extra security verification. When this setting is enabled and the Mac is not connected to the Internet, the DNS lookup could take forever and causes issues with SSH connection.

Even if this setting is disabled by default, it worth to take a look just in case. This setting is called "UseDNS" and the value should be "No". You can find it in the ssdh_config file that I mentioned in Comment 10.

Anyways, if you could make the screencast and share the file contents in it, I can also take a look at that setting among others.

Thanks,
Mauro
Comment 13 mwg@thoughts.net 2017-01-20 14:06:42 UTC
Mauro,

The courrent ssh_config file contents are below. It appears that most of the settings have somehow been commented out.

Marc


# $OpenBSD: ssh_config,v 1.28 2013/09/16 11:35:43 sthen Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

# Apple:
 Host *
   SendEnv LANG LC_*
#   AskPassGUI yes


#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
Comment 14 mag@xamarin.com 2017-01-20 14:20:55 UTC
That is the ssh_config file, which is the SSH client configuration file. In this case this is not the file that is important for us, since what we are using is the SSH server, given that the Mac acts the Server and Visual Studio as the Client.

Please attach the sshd_config file, which is in the same location that the ssh_config.

Thanks,
Mauro
Comment 15 mwg@thoughts.net 2017-01-20 14:56:25 UTC
Before seeing your comments, based on the troubleshooting guide, I made changes to the sshd_config file and reboot the system. The current versions is below:

# $OpenBSD: sshd_config,v 1.95 2015/04/27 21:42:48 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

# See sshd_config(5) for details on setting the Port and Listen values on Mac OS X
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# The default requires explicit activation of protocol 1
#Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Ciphers and keying
#RekeyLimit default none

# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile  .ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords both PasswordAuthentication and
# ChallengeResponseAuthentication must be set to "no".
#PasswordAuthentication no
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# Also, PAM will deny null passwords by default.  If you need to allow
# null passwords, add the "
nullok" option to the end of the
# securityserver.so line in /etc/pam.d/sshd.
#UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#XauthLocation xauth # Default is to search $PATH (set by launchd(8)).  It is recommended that a full path be provided.
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation sandbox
# Default for new installations.
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# pass locale information
AcceptEnv LANG LC_*

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp
/usr/libexec/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
Comment 16 mwg@thoughts.net 2017-01-20 14:58:25 UTC
From Git:

Marc@extreme MINGW64 ~
$ ssh marcgeorge@192.168.1.192
ssh_exchange_identification: read: Connection reset by peer
Comment 17 mwg@thoughts.net 2017-01-20 15:44:35 UTC
I am able to login to localhost on the Mac.
Comment 18 mwg@thoughts.net 2017-01-23 14:47:14 UTC
Created a new cross platform solution. When creating iOS project, it tries to connect to the "mac.local" agent, which says it can't get the SSH fingerprint. What do I need to do to enable the fingerprint or rebuild the fingerprint?
Comment 19 mag@xamarin.com 2017-01-23 15:13:35 UTC
Hi,
As I mentioned before, not getting the fingerprint of a Mac is a sign that the host is unreachable, that the SSH server in that Mac is not running or that something is wrong with the Server at all.

If mac.local is not accessible, please try adding the IP address manually from the XMA Server Selector, and try to connect.

However, you just confirmed that you can't access with Putty too and also you have problems when connecting to localhost from Mac terminal, so I assume that you already tried with both Mac name and also IP address.

Related to the config files, I compared with the sshd_config file of my Mac that I use for development, and the settings are the same. So there should be no problems configuration wise.

Can you please try to ping the Mac address from Windows? If ping completes successfully, try again with Putty to the same address that you made the ping.
Comment 20 mwg@thoughts.net 2017-01-23 19:58:21 UTC
"Ping mac" is successful. "PortQry -n mac -e 22" is successful: Listening. Putty using "mac" | "192.168.1.192" on port 22 fails with "Network error: Software caused connection abort".
Comment 21 mwg@thoughts.net 2017-01-25 21:14:52 UTC
Took a different approach to attempting to open up the SSH connection based on this users successful attempt: http://stackoverflow.com/questions/6313929/how-do-i-open-port-22-in-os-x-10-6-7

I wasn't successful, but there was some interest details which resulted from following his script that might be useful in solving my problem below.

On a different note: Since this mac mini is dedicated to acting as the Mac Agent for my solution, can I just totally reimage it? What process would I need to follow?

mac:~ marcgeorge$ sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
Password:
mac:~ marcgeorge$ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
mac:~ marcgeorge$ ssh -v localhost
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/marcgeorge/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'marcgeorge'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:K4RoV7cPJ1LitxchzLfKWdKwrSxf7Wx9pR4LgYMBG5U
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /Users/marcgeorge/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/marcgeorge/.ssh/id_rsa
debug1: Trying private key: /Users/marcgeorge/.ssh/id_dsa
debug1: Trying private key: /Users/marcgeorge/.ssh/id_ecdsa
debug1: Trying private key: /Users/marcgeorge/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
Password:
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to localhost ([::1]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Wed Jan 25 15:40:40 2017
mac:~ marcgeorge$ ls
Applications
Documents Library
Music Public
Desktop
Downloads Movies
Pictures
mac:~ marcgeorge$ sudo launchctl list | grep "sshd"
-
0 com.openssh.sshd
10517
0 com.openssh.sshd.BDF41FFB-0141-476F-8B85-B0F029D45226
mac:~ marcgeorge$ ssh marcgeorge@192.168.1.192
The authenticity of host '192.168.1.192 (192.168.1.192)' can't be established.
ECDSA key fingerprint is SHA256:K4RoV7cPJ1LitxchzLfKWdKwrSxf7Wx9pR4LgYMBG5U.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.192' (ECDSA) to the list of known hosts.
Password:
Last login: Wed Jan 25 15:43:40 2017 from ::1
mac:~ marcgeorge$ ls
Applications
Documents Library
Music Public
Desktop
Downloads Movies
Pictures
mac:~ marcgeorge$ exit
logout
Connection to 192.168.1.192 closed.
Comment 22 mag@xamarin.com 2017-01-25 21:30:17 UTC
What do you mean by re image it? You can re install the OSX with the latest one and configure it from scratch, for sure. Once you have the OSX installed and the SSH server enabled, you should install the Xamarin pre requirements on the Mac to be able to use VS successfully (Xamarin.iOS, Xamarin.Mac, Mono, etc). You can install Xamarin Studio on the Mac and the rest will be installed as part of it. 
Also, with a fresh install, configuring SSH should be as simple as enabling Remote Login on the System Preferences. You shouldn't do anything else like what you did in the previous comments.

Also, what you showed above looks fine, you were able to connect to localhost from the terminal. You can try the same with Putty and if now you can get to the machine.
Comment 23 mwg@thoughts.net 2017-01-26 02:29:52 UTC
I am still getting the "connection abort" using Putty from my development machine.
Comment 24 mwg@thoughts.net 2017-01-26 14:43:45 UTC
Decided to reset MAC and reinstall iOS and Xcode. In progress... Will update after first test of connecting Mac Agent. Is there a process to uninstall the last Mac Agent?
Comment 25 mag@xamarin.com 2017-01-26 14:57:13 UTC
You don't need to, since the Mac Agent is just a bunch of files copied from Visual Studio as part of the connection process.

But if you want, you can delete this folder: ~/Library/Caches/Xamarin/XMA

Also, remember to install Xamarin Studio for Mac in order to get the Visual Studio pre requisites (Mono, Xamarin iOS, Xamarin Mac, etc). Xamarin Studio IDE is not a pre requisite itself, but installing it is much easier than installing each component separately.
Comment 26 mwg@thoughts.net 2017-01-26 16:32:18 UTC
I don't remember install studio before, just Xcode (the only app which I had installed previously from the Store). All my actual development is in VS 2015 on Windows which is deploy to a iPhone via the Mac. Was there a change that required it?
Comment 27 mwg@thoughts.net 2017-01-26 16:34:02 UTC
I went thru the re-install because of all of the SSH connections issues which were not being resolved.
Comment 28 mag@xamarin.com 2017-01-26 16:54:28 UTC
To use Xamarin in any IDE (Xamarin Studio or Visual Studio) you need some software to be installed, which is a pre requisite to run Xamarin.
Remember that Xamarin allows you to write .net applications that then will result on native apps deployed on you device, an iPhone in this case. So, with VS is not enough, you need software on the Mac that will do the magic.

The requirements are:

Mono: which allows you to run .net apps on the Mac
Xamarin iOS: which allows you to build and run iOS apps built with c# with Xamarin
Xamarin Mac: the same as iOS but for Mac

Installing it by your own could be more annoying than let the Xamarin Studio IDE to install it for you. Because from Visual Studio we don't have the automatic pre requisites installation on the Mac remotely, we require that the user installs it on his own on the Mac (only by now). You can do it manually by yourself or installing Xamarin Studio.

But, please take note that nothing will work if you don't install the mentioned requirements.
Comment 29 mag@xamarin.com 2017-01-26 16:55:20 UTC
Also remember to open and run Xcode at least once, which will prompt you to accept the Xcode license, which is required to use and query it from VS and Xamarin iOS
Comment 30 mag@xamarin.com 2017-01-26 16:55:59 UTC
Also, after the re install did you check that Remote Login is turned on?
Comment 31 mag@xamarin.com 2017-01-26 17:50:47 UTC
One more thing, you can take a look in here to see more about the requirements to get an iOS app running with Visual Studio: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/introduction_to_xamarin_ios_for_visual_studio/#Requirements_Installation
Comment 32 mwg@thoughts.net 2017-01-26 18:16:28 UTC
Long haul, but was finally able to connect with Putty. Thanks for the pointers. Now to see if VS can establish a good Mac Agent. Will look at last pointer.
Comment 33 mwg@thoughts.net 2017-01-29 12:46:38 UTC
Was able to create a Mac Agent this morning. Over the past of days was getting the same fingerprint error. This morning, went back to the MAC and logged in with Terminal; left my session going. Went back to Putty on Windows and logged in. Left Putty logged in. When to VS, the Mac was shown as a possible Agent. Selected and the login popup with the fingerprint was shown. Successfully logged in and connected. 

Is there something that needs to be running that was triggered with the Terminal login to provide the fingerprint? Is there a setting that makes sure it is always started?

Otherwise, case closed.
Comment 34 mag@xamarin.com 2017-01-29 13:08:02 UTC
You shouldn't need anything else than the SSH daemon that OSX has installed as part of it, running.
Putty is just another client, like VS, so you shouldn't need it. The same for the client in the Mac terminal.
Try to connect but without those two clients connected and let's see if that works.
The fingerprint is something that the SSH server sends when a client tries tu connect, so getting the fingerprint just means you are able to see and interact with the SSH server
Comment 35 mwg@thoughts.net 2017-01-30 21:24:07 UTC
Without either an active Putty or a Terminal SSH logon, restarted VS, loaded solution and rebuilt all six projects, including iOS, successfully. The Mac Agent connection seems to be in place and operating. But when trying to deploy to the iPhone, I ran into a DetectSigningIdentity error because of a missing profile (of which I have a copy from before rebuilding the Mac).

However, when trying to re-provision the device manually using https://developer.xamarin.com/guides/ios/getting_started/installation/device_provisioning/#Creating_a_Development_Provisioning_Profile "Step 9", "Double-click" to install the profile, doesn't seem to install the copied profile although Xcode does start. Suggestions?
Comment 36 Brendan Zagaeski (Xamarin Team, assistant) 2017-01-30 21:33:05 UTC
Thanks for the update and confirmation that the Visual Studio is connecting successfully to the Mac now.  I will accordingly mark this bug as resolved answered.

> when trying to re-provision the device manually ... doesn't seem to
> install the copied profile although Xcode does start.

That sounds like a separate troubleshooting topic.  Stack Overflow and the Xamarin Forums might be a good couple first places to search for existing questions and answers about that (or to ask a new question if none of the existing questions sounds like it matches).  See also [1] for additional recommendations on the best places to ask various kinds of questions.

[1] https://developer.xamarin.com/guides/cross-platform/troubleshooting/support-options/



Best,
Brendan
Xamarin Support
Comment 37 Brendan Zagaeski (Xamarin Team, assistant) 2017-01-30 21:36:36 UTC
(As one first small hint, do note that provisioning profiles require private code signing keys stored in the system keychain (as shown in the Keychain Access app).)