Basic Dropbear build instructions:

- First, edit options.h to choose user-defined features to choose, such as
  which ciphers/hashes you want, which forwarding you want, etc.

- Edit debug.h if you want any debug options

- Now configure Dropbear's host-specific options:

./configure      (optionally with --disable-zlib or --disable-syslog,
                  or --help for other options)

- Then compile and optionally install Dropbear:

(the Makefile requires GNU make, if you want to make it portable, send me
 some patches)

make
make install     (installs to /usr/local/sbin, /usr/local/bin by default)

You need to generate server keys, this is one-off:
./dropbearkey -t rsa -f dropbear_rsa_host_key
./dropbearkey -t dss -f dropbear_dss_host_key

or alternatively convert OpenSSH keys to Dropbear:
./dropbearconvert openssh dropbear /etc/ssh/ssh_host_dsa_key dropbear_dss_host_key

And you can now run the server.
./dropbear

or './dropbear -h' to get options.

If the server is run as non-root, you most likely won't be able to allocate a
pty, and you cannot login as any user other than that running the daemon
(obviously). Shadow passwords will also be unusable as non-root.

You can use scp with dropbear, you'll just need to put scp from OpenSSH (or
equivalent) in your path (/usr/bin/scp etc). In a future release Dropbear
will include a scp program.

============================================================================

Compiling with uClibc:

Firstly, make sure you have at least uclibc 0.9.17, as getusershell() in prior
versions is broken. Also note that you may get strange issues if your uClibc
headers don't match the library you are running with, ie the headers might
say that shadow password support exists, but the libraries don't have it.

To compile for uClibc the following should work:

rm config.cache
CC=i386-uclib-gcc ./configure --disable-zlib
make clean
make
make strip

... and that should be it. You can use "make static" to make statically linked 
binaries, and it is advisable to strip the binaries too. If you're looking
to make a small binary, you should remove unneeded ciphers and MD5, by 
editing options.h

It is possible to compile zlib in, by copying zlib.h and zconf.h into a
subdirectory (ie zlibincludes), and 

export CFLAGS="-Izlibincludes -I../zlibincludes"
export LDFLAGS=/usr/lib/libz.a

before ./configure and make.

If you disable zlib, you must explicitly disable compression for the client -
OpenSSH is possibly buggy in this regard, it seems you need to disable it
globally in ~/.ssh/config, not just in the host entry in that file.

You may want to manually disable lastlog recording when using uClibc, configure
with --disable-lastlog. Some uClibc systems have problems using openpty(), so
if you can't log in to a terminal, try ./configure with --disable-openpty to
use an alternative method of tty allocation.

============================================================================

Public key auth:

You can use ~/.ssh/authorized_keys in the same way as with OpenSSH, just put
the key entries in that file. They should be of the form:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwVa6M6cGVmUcLl2cFzkxEoJd06Ub4bVDsYrWvXhvUV+ZAM9uGuewZBDoAqNKJxoIn0Hyd0Nk/yU99UVv6NWV/5YSHtnf35LKds56j7cuzoQpFIdjNwdxAN0PCET/MG8qyskG/2IE2DPNIaJ3Wy+Ws4IZEgdJgPlTYUBWWtCWOGc= someone@hostname

You must make sure that ~/.ssh, and the key file, are only writable by the
user.

NOTE: dropbear ignores authorized_keys options such as those described in the
OpenSSH sshd manpage, and will not allow a login for these keys. 
