remogatto home

Setup Dropbear for GitHub development on Angstrom

9 March 2011

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!

The problem

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:

  1. I didn't readily understand how to generate a pair of proper public/private keys understandable by GitHub

  2. After I got my keys, Github refused to authenticate me using the uploaded public key

The solution

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:

export GIT_SSH=/usr/local/bin/wrap_ssh.sh

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.

Do you like this post?

Then you could be interested in following me on Twitter and/or on Github! Of course, I'll really appreciate comments and feedback! Thanks!

blog comments powered by Disqus
Fork me on GitHub