Hacking an HP Media Vault Pro for RSYNC

Image via Wikipedia

I have a number of HP Media Vault Pro, MV5150s, which I purchased to provide classroom storage at a low cost.  These are MV2, Series 2 Media Vault servers, and the instructions that follow are specific to this series only.  They work great, and I have begun to use them daily with all my classes.  Out of the box they don’t support using rsync and that is one of my critical needs for a variety of functions.

If you can’t open it, you don’t own it.  And it was my first opportunity is a great while to see what embedded Linux systems are about in recent times.  So time to hack.

To start hacking a Media Vault means starting with Lee Devlin’s great website http://www.k0lee.com/hpmediavault/.  It is a great respository for the HP Media Vault community and Lee led me to the two User Support Groups on Yahoo!:

User Support Group

There is an 3300+ member Media Vault user group at Yahoo set up specifically to discuss the HP Media Vault and share information with other users.    You can join the group and ask questions or search its archive of more than 8500 messages if you want to learn more about the HP Media Vault or can’t find the answer to your question in this FAQ.    For hacking purposes, there is another group called Hacking the HP Mediavault.

And both of these led me to installing the ipkg packager.  These instructions work fine:

Download ipkginstall.zip

1. Extract the file.
2. Copy the file (ipkginstall.sh) and the dir (ipkgsetup) to a share on the Media Vault
3. SSH in, and cp the file, and dir to “/”
4. # sh ./ipkginstall.sh

Ipkg is now installed in /opt/bin and I modified /etc/profile to include that in the path.

Then one simply runs “ipkg update” to install the file database and “ipkg install rsync” to install the new version of rsync.  Ipkg installs rsync in /opt/bin and to make it work with remote rsync hosts I added a symbolic link in /sbin to /opt/bin/rsync.

The HP MV2 series uses Busybox linux.  Busybox comes with Dropbear SSH which is compatible with OpenSSH ~/.ssh/authorized_keys public key authentication, so use these simple instructions from Mathias Kettner

SSH login without password

Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don’t want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory ‘/home/a/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh
b@B’s password:

Finally append a’s new public key to b@B:.ssh/authorized_keys and enter b’s password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B ‘cat >> .ssh/authorized_keys’
b@B’s password:

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B hostname

And that was all there is to it.  Follow the caveats.  Know your abilities.  As always your mileage may vary.

Ubuntu Repositories and Proxy Repositories

Ubuntu Repositories | Ubuntu Screencasts

This is an screencast by Alan Pope of the Ubuntu Repositories which is a great overview for someone not familiar with all the options of Repositories.  Alan refers to a later screencast and I hope he covers the routine matter of setting up a local proxy for the home user, or single classroom teacher, who had multiple Ubuntu machines and would like to have them update extremely quickly.

Having mentioned it, now I will need to cover it. Simply put you add a file in the /etc/apt/apt.conf directory numbered appropriately.  I use 00proxy to put it first.  In the proxy configuration file you put the following script line Acquire::http { Proxy “http://localhost:3142”;}; for the master repository.  For all the machines which need to utilize this machine as the local repository to check for already downloaded updates you simply switch localhost to the ip address of the master repository machine.  Well Alan, it would make a great part of the advanced screencast.

Great Ubuntu Tips for Linux Power Users

One of the biggest issues facing someone who has obtained some degree of expertise is maintaining an awareness of tips and tricks that are current.  Practice them whenever you find a list, see what you think, and learn the intricacies of how they work.  One recent list from the great folks at MakeUseOf.com was 15 Great Ubuntu Tips for Linux Power Users .

I thought I would illustrate a quick check down the features to pick up a few things.  Don’t worry about trying everything on the list, or remembering each, that is a trip for beginner.  Bookmark the article, try the items you know have been nagging at you recently, and learn one thing you can put into practice frequently to increase your effectiveness.  What did I try?…