At home, I have setup a Raspberry Pi with the latest version of Raspbian and with ssh enabled.

I also use a Mac Book Pro with OS X 10.9.3. I use ssh pi@ to do some work on the Raspberry Pi, so far no problems.

Then I configured my router, so that the ssh Port of the Raspberry Pi is also available on the Internet.

In my office, I tried to access the Raspberry Pi with ssh over the Internet by ssh pi@myhomepie.at and I get as a result:

ssh_exchange_identification: Connection closed by remote host 

So, I took another machine in my office with Putty on it and I could login with the same command without problem. I tried even an ssh client on my iPad and even that one could connect. Only the Mac Book is not working, from the outside.

At home, I attached my Macbook to the LAN and I could access the Raspberry Pi.

So I edited /etc/hosts.allow on the Raspberry Pi by placing SSHD: ALL Than I set the sshd LogLevel to debug and I checked if my MacBook shows up in /etc/hosts.deny, but there was nothing.

Why does the Mac Book, as the only device, receive the error message:

ssh_exchange_identification: Connection closed by remote host while trying to access from remote.

ssh -Y -p 80 -i ~/bin/keys/pie.rsa -vvv pi@myhomepie.at:

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/piuser/.ssh/config
debug1: /Users/piuser/.ssh/config line 2: Applying options for *
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to myhomepie.at [xx.x.xxx.xxx] port 80.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/piuser/bin/keys/pie.rsa" as a RSA1 public key
debug1: identity file /Users/piuser/bin/keys/pie.rsa type -1
debug1: identity file /Users/piuser/bin/keys/pie.rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
ssh_exchange_identification: Connection closed by remote host

Some Update:

I installed a SLES on the OS X in a VM wit NAT and if I try to connect, I get the same Error. After changed to Bridged, I can connect with the SLES Machine from the VM. Soooooo, as I see that there are only two possible ways.

1.) Somehow my Mac is blocking the access to the Raspberry Pi from the outside orrrrrr

2.) Somewhere on the Raspberry Pi there is the Mac Address of my WLAN or my Eth0 blocked :( but because there is no Firewall right now on and there is nothing within /etc/hosts.deny sooooooo, is there a place within Raspbian where my Mac could be blocked?

So, some Update, I changed the Hosname of my OS X, still no progress. Than, I decided to spoof my Mac Address, which I use to connect from my OS X to the local Router, odd thing I get this, the first time I try to connect by ssh:

ssh: Could not resolve hostname mypi.dyndns.org: nodename nor servname provided, or not known

The Second time I try I get again:

ssh_exchange_identification: Connection closed by remote host

So, right now I grep -r the mac address and the hostname on the Raspberry Pi, I will also look for the local IP my box uses within my Intranet.

  • I also checked a lot of wikis and sites to this, so I would be happy if somebody could point me to an answer, that would help me :) Thanks in Advance – Megatraveller Jul 10 '14 at 16:05
  • Did you have a look at your server logfiles? sshd should write there more details on what is wrong. – Patrick Mevzek Nov 26 '17 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.