So I’m running Hassio on a Pi and am trying to ssh into in so I can back up my configuration to github. I’ve followed all the steps to set up the SSH server on the Pi (generating a new key and what not) but when I try and log in it is refusing the connection and not letting me in.
I have DuckDNS enabled and working so I don’t know if that is contributing to it??
From the Mac - Open Terminal. You should be in your home directory. Then just type nano .ssh/known_hosts
You will have a list of all previous SSH connections. I’m guessing you had one from a prior setup using the same hostname or IP address, so the keys are conflicting. Just delete that line from the known_hosts file, save it and try again.
Just wanted to confirm the above reply, removing the line from the known_hosts file is what you’ll need to do any time your dynamic IP changes.
Here’s a tip to prevent this from needing to be done on your local network. In your router settings under DHCP, set it to assign a specific IP to your Pi’s MAC address. That way it will get the same IP every time if it’s unplugged our rebooted and your DHCP lease has expired.