I'm trying to ssh
to a mac PC from a Ubuntu 16.04 machine. I'm using this command
ssh username@192.168.17.74 -p 9900
The open port is 9900 but I get this error
ssh_exchange_identification: Connection closed by remote host
But if I try ssh username@localhost
form the mac PC then it does not give any error. The firewall is disabled and I have allowed all incoming connections. The OpenSSH version is 7.5p1.
Please note that the mac PC is in a remote geographic location and I'm accessing it via TeamViewer.
Try adding a -v
to your ssh command. That's helped me debug connection issues in the past.
If I had to guess, I'd say that you have the needed credentials on your Mac, but not on the other machine.