0

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.

Harsh Wardhan
  • 2,110
  • 10
  • 36
  • 51

2 Answers2

2

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.

Mattie
  • 2,868
  • 2
  • 25
  • 40
0

I have a reverse port open on the mac, and it's worked for years. I ssh to my Linux server, which opens the back channel, so I can do something like 'scp mac:mac_file .' without any further identification.

After a hardware upgrade, some system settings were lost, and it stopped working, throwing this error.

What fixed it for me was to open Sharing in System Preferences on the mac, and enable Remote Login.

joe
  • 758
  • 1
  • 10
  • 16