1. Check out our companion app, Forums for Android! Download from Google Play

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

Discussion in 'Rooted Devices Only' started by geofferey, Oct 21, 2013.

  1. geofferey

    geofferey Well-Known Member
    Thread Starter
    43

    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 (Text):
    1. $su
    -Findout out TYPE and SOMEBLOCK# using

    Code (Text):
    1. #mount | grep /system
    2. [B]you'll get output like this:[/B]
    3. /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 (Text):
    1. #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 (Text):
    1. #cd /sdcard/persist_sshd_droid
    2.  
    3. #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 (Text):
    1. #disable_sshd
    Self explanatory
    Code (Text):
    1. #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 (Text):
    1. #sshd_config
    SSH client bundled with
    Code (Text):
    1. #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 (Text):
    1. #reverse_ssh
    Connects to SSH via loopback, for use with Android Terminal Emulator when su has been removed/disabled
    Code (Text):
    1. #ssh_auto
     

    Attached Files:


    Advertisement

    LMeier, Sepero and Mikestony like this.
  2. Mikestony

    Mikestony ~30% Carbon Black ±
    Moderator
    3,118

    Sep 10, 2010
    28,239
    21,539
    3,118
    Male
    N/W Indiana
    Hey geofferey!
    I moved your thread here so others with rooted devices can check it out:)
     
    geofferey likes this.
  3. Sepero

    Sepero Linux Guru
    163

    Aug 26, 2010
    963
    593
    163
    Very cool :thumb:
     
    geofferey likes this.
  4. mlyall95

    mlyall95 New Member
    5

    Nov 10, 2013
    3
    0
    5
    Hey geo I just purchased the new Samsung galaxy legend also known as the i200pp I'm trying to root.
    Tried poot and z4root and nothing.
    I have the emulator loaded if that helps and i don't have access to computer.
     
  5. phan9998

    phan9998 Well-Known Member
    16

    Oct 25, 2013
    58
    7
    16
    What does ssh do?
     
  6. Sepero

    Sepero Linux Guru
    163

    Aug 26, 2010
    963
    593
    163
    geofferey likes this.
  7. geofferey

    geofferey Well-Known Member
    Thread Starter
    43

    Updated OP today & recently uploaded new version. More to come :)
     
    Sepero likes this.
  8. yanellap

    yanellap New Member
    15

    Jul 7, 2016
    1
    0
    15
    Male
    Hello, Where is the install.sh ??
    I downloaded the .zip and contains only two folders. System and META
     

Share This Page

Loading...