Changeset 325

Show
Ignore:
Timestamp:
07/21/06 15:52:46 (2 years ago)
Author:
markus
Message:

- added runtime config for password
- added runtime config for ssh-key
- added mkpasswd for crypt-md5 generation (needed for runtime password config)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/package/Config.in

    r299 r325  
    362362          http://www.freewrt.org/downloads/snapshots/@TARGET@/packages 
    363363 
    364 endmenu 
     364config BR2_RUNTIME_PASSWORD 
     365        string "root password" 
     366        default "FreeWRT" 
     367        help 
     368          Predefine the root password enabled in the the built image 
     369 
     370          - Leave empty to disable password login, beware: TELNET WILL BE OPEN! 
     371          - type "-KEY-" to only allow ssh key login and define the ssh-key in 
     372            the next step. 
     373 
     374config BR2_RUNTIME_SSHKEY 
     375        string "SSH public key" 
     376        default "" 
     377        help 
     378          Paste your generated SSH public key here and it will be embedded into 
     379          the built image, so you can use it to login instantly. 
     380 
     381endmenu 
  • trunk/freewrt/package/base-files/Makefile

    r306 r325  
    3636PACKAGES_INSTALL:=$(IPKG_BASE) $(IPKG_UCLIBC)  
    3737 
     38MD5CRYPT := $(shell $(MKPASSWD) "$(BR2_RUNTIME_PASSWORD)") 
     39 
    3840ifeq ($(BR2_PACKAGE_LIBGCC),y) 
    3941PACKAGES+=$(IPKG_LIBGCC) 
     
    6264                    -e '/^src freewrt/s,"\(.*\)",\1,' $(IDIR_BASE)/etc/ipkg.conf 
    6365        $(SED) 's,@TARGET@,$(BOARD)-$(KERNEL),g' $(IDIR_BASE)/etc/ipkg.conf 
     66        test $(BR2_RUNTIME_PASSWORD) -eq "-KEY-" || (|| 
     67            test -n $(BR2_RUNTIME_PASSWORD) && \ 
     68                $(SED) 's,*NP*,$(MD5CRYPT),g' $(IDIR_BASE)/etc/passwd || \ 
     69                $(SED) 's,*NP*,,g' $(IDIR_BASE)/etc/passwd \ 
     70        ) 
     71        test -n $(BR2_RUNTIME_SSHKEY) && ( \ 
     72            mkdir -p $(IDIR_BASE)/etc/dropbear \ 
     73            echo $(BR2_RUNTIME_SSHKEY) > $(IDIR_BASE)/etc/dropbear/authorized_keys \ 
     74        ) 
    6475        mkdir -p $(IDIR_BASE)/dev 
    6576        mkdir -p $(IDIR_BASE)/etc/crontabs 
  • trunk/freewrt/package/base-files/default/etc/passwd

    r181 r325  
    1 root:$1$$M/vfMxhSbKMGpvL4Uxt1G/:0:0:root:/tmp:/bin/ash 
    2 admin:$1$$M/vfMxhSbKMGpvL4Uxt1G/:100:100:admin:/tmp:/bin/ash 
     1root:*NP*:0:0:root:/tmp:/bin/ash 
     2admin:*NP*:100:100:admin:/tmp:/bin/ash 
    33nobody:*:65534:65534:nobody:/var:/bin/false 
  • trunk/freewrt/tools/Makefile

    r248 r325  
    44 
    55TARGETS:=       paxmirabilis sed ipkg-utils brcm-utils lzma 
    6 TARGETS+=       squashfs jffs2 
     6TARGETS+=       squashfs jffs2 mkpasswd 
    77 
    88TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))