Photography
Computing
Tags
Filters
Templates
A little while ago I discovered QuickSSHD, an sshd for Android that comes as an App. The main benefit it is comes as an App and does not require root. QuickSSHD is based on Dropbear (I wrote about it a while ago) and I plan to use it for backing up my Mobile. But first things first: the first step in setting up an sshd is to avoid using password-logon and use pub/priv keys instead. We will go through the step of setting this up. For forther reference and a deeper understanding you may want to read more about this here.
1. Create a dsa-key-pair on your linux client
ssh-keygen -t dsa -f id_dsa-android
Note: I named the key id_dsa-android because that's my own convention
2. Copy the public key to your Android device
scp -P 2222 id_dsa-android.pub <your-ip-goes-here>:/sdcard
Note: This assumes you have password enabled and sshd running on port 2222
3. Validate the public key
cat /sdcard/id_dsa-android.pub >> /data/data/com.teslacoilsw.quicksshd/home/.ssh/authorized_keys
Note: Validating means in this case to copy the pubkey to authorized_keys (it's located in /data/data/com.teslacoilsw.quicksshd/home/.ssh)
4. Configure
Go to your QuickSSHD settings and remove the checkbox Password and check Shared Keys (If you did right the key added to authorized_keys should be listed right under the checkbox.
5. Test
ssh -i <your-home-goes-here>/.ssh/id_dsa-android -p 2222 <your-ip-goes-here>
If everything went fine you should get:
Enter passphrase for key '/home/sven/.ssh/id_dsa-android'
6. Troubleshooting If something does not go as expected you should consider:
A good way of finding out what went wrong and learn more about ssh:
ssh -vvv -i <your-home-goes-here>/.ssh/id_dsa-android -p 2222 <your-ip-goes-here>
Discussion
the QuickSSH documentation, if such a thing existed.
I just add that you can avoid even typing the passphrase by
using ssh-agent