[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dropbear sshd, adding users



On Mon, 19 Jul 2004 Nathan.Smith@xxxxxxx.gov wrote:

> Dropbear was suggested to me, but dropbear is much more complex than
> anything I've compiled. It comes with an install-sh that I would/will
> have to spend lots of time trying to understand. The Makefile.in is also
> very complicated to me. Has anyone compiled an sshd for the one of the
> Axis devices? I would be very interested in seeing your Makefile and how
> you did it.

You could try playing with this one (unpack dropbear in a subdirectory,
below this Makefile:

---8<---
include $(AXIS_TOP_DIR)/tools/build/Rules.axis

PREF_X=usr
SBIN=$(PREF_X)/sbin
BIN=$(PREF_X)/bin
ROOT=root
DOT_SSH=$(ROOT)/.ssh
ETC_FLASH_PART=mnt/flash

ifeq ($(AXIS_BUILDTYPE), host)
HOST=--host=i386-linux-gnu
else
HOST=--host=$(AXIS_BUILDTYPE)
endif


all: build

dropbear/Makefile:
	cd dropbear && \
	CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
		./configure \
		$(HOST) \
		--prefix=$(prefix)/$(PREF_X) \
		--disable-zlib \
		--disable-shadow \
		--disable-lastlog \
		--disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx \
		--disable-pututline --disable-pututxline
	[ -f multi_options.h ] && cp -f multi_options.h dropbear/options.h

build: dropbear/Makefile
	$(MAKE) -C dropbear dropbearmulti RANLIB="$(RANLIB)" AR="$(AR)"

install: all
	$(INSTALL) -d $(prefix)/etc/dropbear
	$(INSTALL) -d $(prefix)/$(SBIN)
	$(INSTALL) -m 0755 dropbear/dropbearmulti $(prefix)/$(SBIN)
	$(LN) -sfn /$(SBIN)/dropbearmulti $(prefix)/$(SBIN)/dropbear
	$(LN) -sfn /$(SBIN)/dropbearmulti $(prefix)/$(BIN)/dropbearkey

	$(INSTALL) -m 0700 -d $(prefix)/$(ROOT)
	$(INSTALL) -m 0700 -d $(prefix)/$(ETC_FLASH_PART)/$(DOT_SSH)
	$(LN) -sfn ../$(ETC_FLASH_PART)/$(DOT_SSH) $(prefix)/$(DOT_SSH)
	touch $(prefix)/$(ETC_FLASH_PART)/$(DOT_SSH)/authorized_keys
	chmod 0600 $(prefix)/$(ETC_FLASH_PART)/$(DOT_SSH)/authorized_keys

clean:
	-cd dropbear && test -f Makefile && $(MAKE) clean && \
		rm -f Makefile config.h config.log config.status
---8<---


hth,
Cristian