2014年6月1日 星期日

Launch DroidSSh as service on CyanogenMod

       I am find the way that launch the sshd as service for long time, I hope the sshd will not been destroy while system low memory while launch as service, it need more exam. Even the CyanogenMod build in the sshd, but I'm bad luck ... it show me "Segmentation fault" or "void endpwent()(3) is not implemented on Android" on my two difference device, finally I found the easiest way for the goal.

The DroidSSH is always stable on my two device, it never complain any problem to me, it is a option of my goal and it is only success of my trying, ok let beginning.

1. Install the DroidSSH from Google Play and launch it, it will spend more time at first run, the others procedure you may setting your device with DroidSSH or your terminal emulation.

2. Create the directory /data/local/userinit.d
3. Create file /data/local/userinit.d/90sshd and edit it.
4. paste the contents bellow



# ================ start ===================
#!/system/bin/sh

umask 077
/data/data/berserker.android.apps.sshdroid/dropbear/dropbear -H /data/user -Y "PASSWORD" -S -p 22 -r /data/data/berserker.android.apps.sshdroid/dropbear/dropbear.key.rsa -d /data/data/berserker.android.apps.sshdroid/dropbear/dropbear.key.dss

#================= end ===================

 5. Change the permission and group

chmod 755 /data/local/userinit.d/90sshd
chgrp shell /data/local/userinit.d/90sshd


 Ok, it finish, reboot your device, it will start as service.


Note: 
1. -H mean the home directory of user.
2. -Y specify the password, you should change it.


My reference:

沒有留言:

張貼留言