back to index

SSH and SCP to/from an Android smartphone



There is a smartphone. It is rooted, as smartphones should be. There is need to connect to it from another machine and run processes and copy files to/from in a reasonably standard way.

There is a pretty good freeware Android app built around the Dropbear ssh server; rather rudimentary but does the job: DropBearServer II, "me.shkschneider.dropbearserver2". At this moment it does not seem to be in the Google Play Store anymore, said to be discontinued. The source is however here. The author is here.

The app's apk is still out there and has to be sideloaded. Here is one of the sources:,90020.html (local copy: me.shkschneider.dropbearserver2.downloader.apk, of version 1.5.4.

The server provides decent ssh access, with support of keys. It however does not support scp out of the box, the binary is not in place:

scp on DropbearServerII on android:
Welcome to DropBear SSH Server II!
sh: scp: command not found
lost connection

The search of the internet was mostly not fruitful, the scp binary was next to nowhere to be found.


A "kbox" package was found here: The package itself is located at It is however rather large, with lots of source codes.

The needed files are some third-party binaries, included in the subdirectory ./kbox_term/contrib_image/bin/, which is mirrored here.

The scp and ssh binaries are needed. The ssh path in the scp binary is hardcoded, so it has to be specified from the commandline. For this reason, "scp" is a wrapper that runs "scp.bin" with the proper parameters:

scp.bin -S /system/bin/ssh "$@"

The files are copied to the /system/bin directory, after unlocking it for write with "mount -o remount,rw /system" and then lock it again with "mount -o remount,ro /system".


The binaries available also have the "dropbear" binary, a sshd server. It can run the sshd server from a commandline or a shell script. This can be linked to events, like joining a certain wifi network.

If you have any comments or questions about the topic, please let me know here:
Your name:
Your email:
Leave this empty!
Only spambots enter stuff here.