[APP] DropBear Server II // ssh/scp (root only)

vbrtrmn

Member
Sep 22, 2010
40
23
0
I wanted to enable SCP and SSH using DropBear II ... for some reason DropBear Server II doesn't install scp & ssh binaries, you can get them from github and symlink it into system. Here's what I did...

DropBear archive (1M): https://www.dropbox.com/s/h2guipuvdltiden/dropbearii.zip

Feel free to mirror that if you want.

These directions allow you to ssh into the system as root, be very careful. I recommend not leaving the service running if you are not using it.

I take no responsibility if you brick your unit while mucking around as root.

  1. Back Up
  2. Download dropbearii.zip and unzip on your local file system.
  3. From your local filesystem install the APK and push scp & ssh to tmp.
    Code:
    adb install DropBearServer2.1.apk
    adb push scp /data/local/tmp/scp
    adb push ssh /data/local/tmp/ssh
  4. From the OUYA GUI install the DropBearServerII service... Select Make -> Software -> DropBearServer II -> Install
  5. Shell into your OUYA and make /system writable.
    Code:
    adb shell
    su
    mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
  6. Move scp & ssh into DropBear II directory
    Code:
    mv /data/local/tmp/scp /data/data/me.shkschneider.dropbearserver2/app_data/
    mv /data/local/tmp/ssh /data/data/me.shkschneider.dropbearserver2/app_data/
  7. Change the permissions
    Code:
    chmod 6555 /data/data/me.shkschneider.dropbearserver2/app_data/scp
    chmod 6555 /data/data/me.shkschneider.dropbearserver2/app_data/ssh
  8. Create the symlinks
    Code:
    cd /system/bin/
    ln -s /data/data/me.shkschneider.dropbearserver2/app_data/scp ./scp
    ln -s /data/data/me.shkschneider.dropbearserver2/app_data/ssh ./ssh
  9. Change /system back to read-only (optional) and exit.
    Code:
    mount -o ro,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
    exit
    exit
  10. Reboot the OUYA (optional)
    Code:
    adb reboot

Notes/testing
  • Windows users can use Putty to ssh & scp get them here.
  • To ssh into the system:
    Code:
    ssh [email protected]_ADDRESS
  • To scp a file to the sdcard:
    Code:
    scp ./some_file [email protected]_ADDRESS:/sdcard/
  • To get to settings push the U circle button one time.
  • If you turn on "Start on boot" in the settings menu and reboot, the service will be turned off. Though it will be left on in the standard standby mode.
  • I recommend using pubkey rather than password. Basically generate a public key and push it into /sdcard/ then install it from the DropBear II app.
    Unix Hosts can do:
    Code:
    ssh-keygen -t rsa
    Windows using PuttySSH follow these directions, I haven't tested them though.
  • If you don't want to be bothered with pubkey, please change the default password it is set to 42.
  • If you already know about pubkey, you can cat them into: /data/data/me.shkschneider.dropbearserver2/app_data/authorized_keys
  • Unchecking "Allow Password" doesn't work properly.

Why would I want to do this? I didn't really like the Wireless ADB disappearing after the OTA upgrade, this may be less annoying if the next OTA doesn't nuke it.
 
Last edited:

fatfishycell

Member
Feb 9, 2008
18
3
0
I'm getting an error that busybox is not installed when trying to start the service. Is there anything special you had to do with busybox to get this to run? I installed it via the apk.

Edit: Nevermind. I didn't realize the busybox apk was an installer and I didn't find the icon when I looked. Just checked again and found the busybox installer icon and did a smart install. Dropbear ssh is running now.
 
Last edited:

DualJoe

Senior Member
Oct 12, 2011
2,050
930
193
de
I ran it manually with
Code:
dropbear -E -s -P /data/dropbear/dropbear.pid -r /data/dropbear/dropbear_rsa_host_key -d /data/dropbear/dropbear_dss_host_key
and it looks ok when idling but when connection it gives me

Aiee, segfault! You should probably report this as a bug to the developer
This could be CM10.1 environment issues (libc). The built-in SSHd doesn't work properly as well. Some binaries give strange errors when executed with SSHd (like sqlite3).
 

andlid

Member
Nov 29, 2009
48
2
0
I can't install the DropBearServer II from the Make option, comes up with "operation failed". Tried to make the system rw to see if that might have been the problem but still no luck. Anyone else had that problem?
 

vbrtrmn

Member
Sep 22, 2010
40
23
0
I can't install the DropBearServer II from the Make option, comes up with "operation failed". Tried to make the system rw to see if that might have been the problem but still no luck. Anyone else had that problem?
I installed it via adb.

For others I was able to install using IncognitoMan's -=StockPlus=- ROM -- http://forum.xda-developers.com/showthread.php?t=2347214

You may need busybox installed, I'm not 100% sure, I haven't tried without busybox.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone