Build a Weather Station with Elixir and Nerves: 'mix deps.get' does not work if user has not created a keyfile (page 16)

Running mix deps.get in the sensor_hub directory fails with the following error:

** (Mix) No SSH public keys found in ~/.ssh. An ssh authorized key is needed to
log into the Nerves device and update firmware on it using ssh.
See your project's config.exs for this error message.

I expect this is because config/target.exs is looking for a public keyfile (specifically, one of three names), but the text doesn’t talk about needing one or how to create one.

OS: macOS 11.5.2
Fresh checkout of asdf v0.8.0
Fresh installs of erlang 24.0.3 and elixir 1.12.2-otp-24.

Good call out! I’ll be sure to add a note in the book for this issue. All you should have to do it run ssh-keygen and re-create the firmware. For more details take a look at this part of the Nerves documentation: Nerves.Firmware.SSH — nerves_firmware_ssh v0.4.6

1 Like

I am getting the same error. I have run the two statements on the link provided(mkdir and ssh-keygen) and it created keys in the rootfs-additions/etc/ssh/ssh_host_rsa_key directory but it still doesn’t work. I copied the keys to my ~/.ssh directory and that doesn’t do it. This seems like a great book and I bought it because it was mentioned at the July Nerves Meetup (my first) but it is frustrating to get stuck so early in the process. Oddly, trying to do the “Creating a new Nerves app” exercise on the Getting Started page in the Nerves documentation yields the same error but there is no mention of why it occurs or how to fix it.
The solution was in the link provided. For some reason, including the key in the config file didn’t work but including the path to the key file did work. So I was able to get past that point.