This is an example for Android 5.0 on arm.
- Get Android NDK
curl -O https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip unzip android-ndk-r15c-linux-x86_64.zip
- Build the NDK
cd android-ndk-r15c/build/tools ./make_standalone_toolchain.py --install-dir=../../../android-ndk --arch=arm --api=21 --deprecated-headers
- Add the new android-ndk/bin to the $PATH
export <full path>/android-ndk/bin:$PATH
-
Download source
git clone --recursive https://github.com/PDi-Communication-Systems-Inc/dropbear-android-build.git
-
Edit the HOST variables in build.sh to match your environment if required
-
Compile
cd dropbear-android-build/dropbear ../build.sh <arch>
You will find the output in
dropbear-android-build/target/<arch>
.
By default it is intended to be run from/data/dropbear
, this can be changed using command line arguments. -
Running
ln -s dropbearmulti dropbear ln -s dropbearmulti dropbearkey ln -s dropbearmulti dbclient ln -s dropbearmulti scp # Generate host key ./dropbearkey -f dropbear_rsa_host_key -t rsa -s 4096 mv dropbear_rsa_host_key /system/etc/dropbear/ # Starting server ./dropbear -A -N root -U 0 -G 0 -R <path of authorized_keys>
This supports encrypted passwords using crypt()
Just add -e
to the end of your server arguments and provide a password generated with mkpasswd -mSHA-512
Note: -e
MUST be specified last. Somehow it's being reset otherwise.
For SCP to work you will need to symlink dropbearmulti
to /system/xbin/scp
Description of original Android patch is here.