Notice: this project is no longer maintained As an alternative, see: termux

These notes are from 2012, and probably won't work.

Goal

SSH or SFTP into your phone with a regular client.

Install the package

This requires that you have a rooted phone, and you have Android Ports installed.

Setup the environment

dropbear is built to only allow public-key authentication. It is also configured to consider /data/root as root's home directory. The package should have created a /data/root directory for you already. Next step is to generate a key with your ssh client (not covered in this tutorial), and then put that key in the list of authorized keys.

Start a root shell on your phone (adb shell or terminal + su)
Notes: bold = typed

/ # busybox mkdir /data/root
/ # busybox chmod 700 /data/root
/ # cd /data/root
/data/root # busybox mkdir .ssh
/data/root # busybox chmod 700 .ssh
/data/root # cat <<EOF >.ssh/authorized_keys
> ssh-rsa [your_ssh_key] [your_ssh_key_id]
> EOF
/data/root # busybox chmod 600 .ssh/authorized_keys
/data/root # /data/local/bin/dropbear

To verify your results

From another machine with the ssh key:

$ ssh root@[phone_ip]
/data/root #

If dropbear refuses the public key (openssh says: "Permission denied (publickey)."), double-check your permissions on /data/root, /data/root/.ssh, and /data/root/.ssh/authorized_keys. Also double-check that your /data/root/.ssh/authorized_keys contains the correct key and it didn't linewrap

If dropbear accepts the authentication and drops the connection, check to see if you have a /system/xbin/ash. If you don't, create it as a symlink to your shell.

If this does not work, you can kill dropbear and start it with the -F flag. This will print logs to your terminal.