SCP without passwords

In embedded development, there is the problem that after you build the code on your host PC, you have to load onto the target. My normal solution for this is to create an NFS mount to a folder on the host that contains the binaries and the necessary auxiliary files. I was motivated to load the files via scp, but I prefer to automate my development cycle as much as possible. This means calling scp from the makefile, which means calling it without a password. I knew it was possible to set up a system that allowed this, so I turned to Google.

I searched for “scp in scripts”. The first link seemed very authoritative and gave instructions that used ssh-keygen to create a public RSA key to put in the host’s ~\.ssh\authorized_keys file. Possibly because the target is using Dropbear for ssh, these instructions didn’t work and I spent a significant amount of time trying to debug the system.

A co-worker that I had dragged into the problem gave me a different solution that did work. When I asked him where he found his solution, he said “Google”. To my frustration, his link was the first link for him on the search “scp without password”. This illustrates the principle that you should always ask Google for exactly what you want.

Tags:

Leave a Reply

Comment moderation is enabled. Your comment may take some time to appear.