1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-11-13 18:58:57 +00:00
simplesshd/dropbear
Greg Alexander 2eb8fa9355 don't clear the environment when spawning shells, so that android system
variables remain available (so you can run 'am' and 'pm')
2016-06-18 15:15:27 -04:00
..
debian stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
libtomcrypt add LTC_SOURCE to each libtomcrypt .c file because that's easier than 2014-12-16 22:07:06 -05:00
libtommath stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
.hg_archival.txt stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
.hgsigs stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
.hgtags stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
.travis.yml stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
agentfwd.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
algo.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
atomicio.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
atomicio.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
auth.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
bignum.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
bignum.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
buffer.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
buffer.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
CHANGES stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
channel.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
chansession.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
circbuffer.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
circbuffer.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-agentfwd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-auth.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-authinteract.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-authpasswd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-authpubkey.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-channel.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-chansession.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-kex.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-main.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-runopts.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-session.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
cli-tcpfwd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
common-algo.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
common-channel.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
common-chansession.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
common-kex.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
common-runopts.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
common-session.c use configuration values instead of getpwnam() 2014-12-16 23:06:04 -05:00
compat.c fix bug in dropbear - returning address of local variable!! 2014-12-14 08:29:27 -05:00
compat.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
config.guess stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
config.h.in stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
config.sub stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
configure stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
configure.ac stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
crypto_desc.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
crypto_desc.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
curve25519-donna.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dbclient.1 stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dbmulti.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dbrandom.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dbrandom.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dbutil.c give a warning and "unknown<af>.unknown" if we fail to get a string for 2015-11-23 08:16:43 -05:00
dbutil.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
debug.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dropbear.8 stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dropbearconvert.1 stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dropbearconvert.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dropbearkey.1 stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dropbearkey.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dss.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
dss.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ecc.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ecc.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ecdsa.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ecdsa.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
fake-rfc2553.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
fake-rfc2553.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
filelist.txt stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
gendss.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
gendss.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
genrsa.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
genrsa.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
gensignkey.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
gensignkey.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
includes.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
INSTALL stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
install-sh stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
kex.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
keyimport.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
keyimport.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
LICENSE stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
list.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
list.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
listener.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
listener.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
loginrec.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
loginrec.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ltc_prng.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ltc_prng.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
Makefile.in stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
MULTI stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
options.h this is the only change necessary to make sftp-server "work" with dropbear 2014-12-21 17:41:40 -05:00
packet.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
packet.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
process-packet.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
progressmeter.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
progressmeter.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
queue.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
queue.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
README stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
release.sh stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
rsa.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
rsa.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
runopts.h Revert "get rid of pid file" 2014-12-16 18:20:29 -05:00
scp.c build scp as a separate executable 2014-12-21 14:58:24 -05:00
scpmisc.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
scpmisc.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
service.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
session.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
signkey.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
signkey.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
SMALL stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
ssh.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
sshpty.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
sshpty.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-agentfwd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-auth.c use configuration values instead of getpwnam() 2014-12-16 23:06:04 -05:00
svr-authpam.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-authpasswd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-authpubkey.c use configuration values instead of getpwnam() 2014-12-16 23:06:04 -05:00
svr-authpubkeyoptions.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-chansession.c don't clear the environment when spawning shells, so that android system 2016-06-18 15:15:27 -04:00
svr-kex.c use rename() if the underlying filesystem doesn't support link() 2014-12-16 22:24:34 -05:00
svr-main.c Revert "get rid of pid file" 2014-12-16 18:20:29 -05:00
svr-runopts.c Revert "get rid of pid file" 2014-12-16 18:20:29 -05:00
svr-service.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-session.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-tcpfwd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
svr-x11fwd.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
sysoptions.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
tcp-accept.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
tcpfwd.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
termcodes.c stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
termcodes.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
TODO stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00
x11fwd.h stock dropbear-2014.66 source tree 2014-12-10 16:56:49 -05:00

This is Dropbear, a smallish SSH server and client.
https://matt.ucc.asn.au/dropbear/dropbear.html

INSTALL has compilation instructions.

MULTI has instructions on making a multi-purpose binary (ie a single binary
which performs multiple tasks, to save disk space)

SMALL has some tips on creating small binaries.

See TODO for a few of the things I know need looking at, and please contact
me if you have any questions/bugs found/features/ideas/comments etc :)

Matt Johnston
matt@ucc.asn.au


In the absence of detailed documentation, some notes follow:
============================================================================

Server 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. Beware of editors that split the key into multiple lines.

Dropbear supports some options for authorized_keys entries, see the manpage.

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

Client public key auth:

Dropbear can do public key auth as a client, but you will have to convert
OpenSSH style keys to Dropbear format, or use dropbearkey to create them.

If you have an OpenSSH-style private key ~/.ssh/id_rsa, you need to do:

dropbearconvert openssh dropbear ~/.ssh/id_rsa  ~/.ssh/id_rsa.db
dbclient -i ~/.ssh/id_rsa.db <hostname>

Dropbear does not support encrypted hostkeys though can connect to ssh-agent.

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

If you want to get the public-key portion of a Dropbear private key, look at
dropbearkey's '-y' option.

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

To run the server, you need to server keys, this is one-off:
./dropbearkey -t rsa -f dropbear_rsa_host_key
./dropbearkey -t dss -f dropbear_dss_host_key
./dropbearkey -t ecdsa -f dropbear_ecdsa_host_key

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

You can also get Dropbear to create keys when the first connection is made -
this is preferable to generating keys when the system boots. Make sure 
/etc/dropbear/ exists and then pass '-R' to the dropbear server.

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

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.

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

The Dropbear distribution includes a standalone version of OpenSSH's scp
program. You can compile it with "make scp", you may want to change the path
of the ssh binary, specified by _PATH_SSH_PROGRAM in options.h . By default
the progress meter isn't compiled in to save space, you can enable it by 
adding 'SCPPROGRESS=1' to the make commandline.