This is just a note to myself rather then a comprehensive blog post. However, I thought it could be helpful for someone else, so here we are!
Dropbear is a small SSH2 server and client. Its small memory footprint is suitable for embedded devices like the BeagleBoard and the OpenPandora. In fact, dropbear is installed by default in the OpenPandora OS (an Angstrom-derived OS) replacing the standard OpenSSH distribution.
However, when I decided to do my first coding experiment with the Pandora, I had some issue interacting with github. In particular:
I didn't readily understand how to generate a pair of proper public/private keys understandable by GitHub
After I got my keys, Github refused to authenticate me using the uploaded public key
Well, the first point was trivial. To generate the keys we need to install the openssh-keygen:
sudo opkg install openssh-keygen
At this point, we can proceed as usual, generating our keys:
ssh-keygen -t rsa
and then uploading the content of id_rsa.pub on our github account.
I solved the second issue thanks to this blog post. The problem resides in the fact that the dropbear client doesn't automatically look in ~/.ssh/ for a public key. To do that, we need to create a wrapper script in /usr/local/bin. I named the script wrap_ssh.sh and I put in it the following content:
#!/bin/sh ssh -i ~/.ssh/id_rsa $*
Don't forget to make the script executable:
sudo chmod +x /usr/local/bin/wrap_ssh.sh
At this point, we need to tell git to use wrap_ssh.sh instead of the plain ssh command. This action is accomplished setting the GIT_SSH environment variable:
To make this change permanent, you should add the line above in your ~/.bashrc file.
Now, you should be able to interact with your github repository from your device.