I run SSHd on my Android phone. This means I can copy files via wireless SFTP, and back it up with BackupPC. It beats using USB or Dropbox. With Android 4.1 and up (Jelly Bean), the default umask for files has changed from “000” (users/programs can write to nearly any file) to “077” (users/programs can only write to files they own). This is better, but meanwhile many Android programs expect the old behaviour. QuickSSHd (a 99p Android dropbear SSH server) is one of them.
This is really just a user interface bug. QuickSSHd is still starting dropbear, it just can’t read the server PID file to verify that it is running. The workaround is to rename the “dropbear” binary in /data/data/com.teslacoilsw.quicksshd/dropbear/, and replace it with a script which adjusts the umask before calling the real dropbear.
So start QuickSSHd once, and ignore the appearance that it’s not running. Then login as root (or use su in a terminal) and run:
cd /data/data/com.teslacoilsw.quicksshd/dropbear/ cp -a dropbear dropbear.real cat > dropbear << END_OF_LINE #!/system/bin/sh umask 000 /data/data/com.teslacoilsw.quicksshd/dropbear/dropbear.real "$@" END_OF_LINE
The cp -a
ensures that the new dropbear script is owned by the right user and have the right permissions. If not, you will need to use chown and chmod to fix it. The right user/group will be different on each Android device, and the permissions should be the same as the original dropbear (now dropbear.real).
After applying this fix, you will need to reboot your phone, or kill the running dropbear using ps
and kill
. After that, QuickSSHd should work as normal.
-
Thanks for your detailed instructions.
My experience:
There is no “cp” available, so I did a “mv dropbear dropbear.real”
Then I created a new “dropbear” script (using WinSCP connected to my Android)
I copied the 3 lines in the script.
With WinSCP I changed the permissions of the script to make it executable, et voilĂ !-
I have an Android 4.1.2 on a Galaxy S3 I-535 Verizon.
-
Thanks! This is helpful.
-
Thank you.
-
Thanks. Nexus 4 KK-KRT16S
-
6 comments
Comments feed for this article
Trackback link: https://www.tolaris.com/2013/04/07/quicksshd-dropbearssh-wont-run-under-android-jelly-bean/trackback/