Fixing the RetroPie SSH Connection Problem On Mac OSX

If you’re like most RetroPie users, you have probably flashed your SD card a number of times testing out various things the wonderful distribution has to offer. The small problem with doing this is that, once you have connected to your raspberry pi utilizing the SSH protocol, MacOS stores this data as well as information about the host in a cache.

RetroPie SSH Fix OSX

If you’re like most RetroPie users, you have probably flashed your SD card a number of times testing out various things the wonderful distribution has to offer. The small problem with doing this is that, once you have connected to your raspberry pi utilizing the SSH protocol, MacOS stores this data as well as information about the host in a cache.

Once you then re-flash the card and try to connect again, a data discrepancy occurs that alerts security protocols. This is telling MacOS that the pi might now be a malicious system trying to disguise itself as your original RetroPie image.


NostalgiaTechs:~ Station$ ssh pi@retropie.local
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for retropie.local has changed,
and the key for the corresponding IP address ddd::4gd7:df26:6d82:4gdt
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:9bmn5bf74XY/HpiMUvmOo6ludNUOngFNVvNyQjAlALaOzME8.
Please contact your system administrator.
Add correct host key in /Users/Station/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/Station/.ssh/known_hosts:3
ECDSA host key for retropie.local has changed and you have requested strict checking.
Host key verification failed.
NostalgiaTechs:~ Station$

In this instance, the warning is actually nothing to worry about. Follow along below as we go through fixing the RetroPie SSH connection problem on MacOS.

All you need to do is open a terminal window on MacOS, and issue the command below.


NostalgiaTechs:~ Station$ ssh-keygen -R retropie.local
# Host retropie.local found: line 3
/Users/Station/.ssh/known_hosts updated.
Original contents retained as /Users/Station/.ssh/known_hosts.old
NostalgiaTechs:~ Station$ 

Once the command has been issued successfully, you should now be able to SSH into the Raspberry Pi as normal. Make sure to type the word “yes” and hit enter when prompted as show below.


NostalgiaTechs:~ Station$ ssh pi@retropie.local
The authenticity of host 'retropie.local (ddd::4gd7:df26:6d82:4gdt)' can't be established.
ECDSA key fingerprint is SHA256:4bmn5bfdf74XY/HpiMUvmOo6ludNUOngFNVvNyQjAlALaOzME8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'retropie.local,ddd::4gd7:df26:6d82:4gdt' (ECDSA) to the list of known hosts. 

Now all you have to do is enter the default password for your distribution. In the case of RetroPie that password is “raspberry”.


pi@retropie.local's password: 

     .***.     Friday, 20 January 2017,  7:12:28 pm UTC
     *****     Linux 4.4.13-v7+ armv7l GNU/Linux
     `***'     
      |*|      Filesystem      Size  Used Avail Use% Mounted on
      |*|      /dev/root        29G   27G  1.1G  97% /
    ..|*|..    Uptime.............: 0 days, 00h20m17s
  .*** * ***.  Memory.............: 424188kB (Free) / 752872kB (Total)
  *******@@**  Running Processes..: 136
  `*****@@**'  IP Address.........: 172.16.0.196
   `*******'   Temperature........: CPU: 39°C/102°F GPU: 39°C/102°F
     `"""'     The RetroPie Project, https://retropie.org.uk

pi@retropie:~ $ 

You have now successfully reset the SSH keys for the RetroPie cache on your local computer. We hope this was helpful and let us know any comments you have. We love to hear from you.