Installing dropbear an a PCH-A200/A210 (NMT – Networked Media Tank)

First, install opkg by using the NMT Community Software Installer. If you are using Ubuntu, install sudo apt-get install mono-complete (which is probably more than you need) to make NMT-CSI run. Download the opkg package, then run sh "Linux Start.sh" and go to File -> Install from File -> opkg_c200_v0.1.8-nmt1.zip. Of course you need to start FTP in order to connect to your device. For more details, go here.

Once opkg is installed get the package list opkg update and install opkg install dropbear. This failed with my setup, so I had to configure it manually:

  • create keys: dropbearkey -t dss -f dropbear_dss_host_key, dropbearkey -t rsa -s 1024 -f dropbear_rsa_host_key
  • copy them to /share/.ssh and make them chmod 600
  • also copy your authorized_keys to this directory

After that, I modified /share/Apps/local/etc/init.d/51dropbear.sh in order to start dropbear (inspired by this thread).

#!/bin/sh
[ -e /share/Apps/local/etc/default/dropbear ] && . /share/Apps/local/etc/default/dropbear
if [ "$DROPBEAR_ENABLE" = "no" ]; then
    exit
fi
if [ -n "`pidof /share/Apps/local/sbin/dropbear`" ]; then
    killall /share/Apps/local/sbin/dropbear 2>/dev/null
fi
# root does not have a shell, so ssh wont work. Give the root a shell
sed -i 's#root:x:0:0:root:/root:/bin/true#root:x:0:0:root:/root:/bin/sh#g' /etc/passwd
mkdir -p /etc/dropbear
cp /share/.ssh/dropbear_dss_host_key /etc/dropbear
mkdir -p /root/.ssh
chmod 700 /root/.ssh
cp /share/.ssh/authorized_keys /root/.ssh/
chown root.root /root
# -s Disable password logins
/share/Apps/local/sbin/dropbear -s

Lets hope that the installation of an ssh server on the new Popcorn Hour A-300 is a bit easier.

Update 15.12.2011: I installed unison for doing backups on my NMT. Unfortunately, I did not find the package here. However, it turned out to be easier than I thougt. Instead of cross-compiling my own package, I tried the package from debian, and it worked by just copying the binary into the /share/Apps/local/bin/. The only problem is the CPU that slows the encrypted traffic down to around 10MBit/s.