• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods [MOD][HOW-TO] - Native Persistent System SSH Server/Daemon for Android [Root only]

PERSIST DROID SSHD - The persistent lil SSH server

The usual... STOP! READ ALL OF THIS POST BEFORE CONTINUING TO INSTALL:
I WILL NOT BE HELD RESPONSIBLE FOR LOSS OF DATA, LOSS OF ROOT ACCESS, BRICKED DEVICES,
CRY BABIES, TEMPER TANTRUMS RESULTING IN SMASHED DEVICES OR ANY OF THAT NOISE.


I've modified an SSH server/daemon to install to /system, start on boot and even function after the phone has been wiped of it's user data. Because dropbear is executed with root UID some ROMs allow you to completely remove su binaries and superuser app while maintaining root shell /filesystem access on device through SSH. I am looking for people who may be interested in it. This is for rooted phones only.

This folder contains a persistent SSH daemon/server with sftp support which has been designed to run at boot even if the user data partition has been wiped on the device. I used the (droidsshd) br.com.bott.droidsshd apks inards as the core of my daemon,along with some scripts/config files that I wrote to manipulate it's dropbear binaries. This will need to be installed using CWM, Terminal Emulator or ADB Shell on a rooted device preferably with init.d support so it can be started on boot, but daemon can be started manually too. If you are experienced in bash/shell scripting, have any recommendations/suggestions please let me know by emailing me at 2wyte.infinity@gmail.com or replying in forums where I post this.

Based in part on THIS guide.

The most recent version as of now is 1.3, you can download it HERE


REQUIREMENTS:

-Initial root access/write access to /system

-Android Terminal Emulator, ADB shell or an SSH server installed from app store.

-Ability to write to /system

-Busybox installed (comes with most roms)

-BASH in /system/xbin (comes with most roms that include busybox)

-init.d support (for auto start on boot, which is the point of this ;) )

-Custom Recovery clockworkmod 5 based for .zip install


TO INSTALL THIS DAEOM:


-Flash .ZIP from CWM reboot, mount system as R/W & run sshd_config in terminal emulator

OR if you don't have CWM

-Extract persist_droid_sshd folder from .7z archive if you haven't already

-Copy persist_droid_sshd folder to sdcard on device

-Download Terminal Emulator app (from market) or use ADB Shell

-Grant SU privileges in Terminal Emulator

Code:
$su
-Findout out TYPE and SOMEBLOCK# using

Code:
#mount | grep /system
[B]you'll get output like this:[/B]
/dev/block/SOMEBLOCK# on /system type TYPE (rw,relatime)
-Now mount system as read write

You could also use a root file explorer or ES file exlporer to mount /system as R/W

Code:
#mount -o remount,rw -t TYPE /dev/block/SOMEBLOCK# /system
-Then navigate to the directory where persist_droid_sshd folder is
most likely /sdcard/persist_sshd_droid

Code:
#cd /sdcard/persist_sshd_droid

#sh install_sshd
-Script will run and have you configure daemon.


OTHER OPTIONS AFTER INSTALL:

-You can run these anytime from the Terminal Emulator, ADB Interface or SSH to control daemon

Stops SSH daemon and disables automatic start of daemon at boot
Code:
#disable_sshd
Self explanatory
Code:
#uninstall_sshd
Re-runs the script that was used to configure sshd at install that changes pass/port/keys must mount system R/W default password is blank on first setup
Code:
#sshd_config
SSH client bundled with
Code:
#ssh
establishes a reverse ssh connection to server specified during configuration in short it will allow you to SSH into your device even if you are on a mobile connection. If you don't know what it is I highly suggest looking it up on google. This feature is advanced & still in it's EXPERIMENTAL stages. I have more to come for it ;)
Code:
#reverse_ssh
Connects to SSH via loopback, for use with Android Terminal Emulator when su has been removed/disabled
Code:
#ssh_auto
 

Attachments

  • Persist_DroidSSHD-v1.3.zip
    944.6 KB · Views: 461

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones