diff options
author | luigi <luigi@FreeBSD.org> | 2013-09-06 17:18:43 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2013-09-06 17:18:43 +0000 |
commit | 0c8c98d14ef26be4fb8eb751587566399b622d67 (patch) | |
tree | 24c34c3e9c0cde703b93232a9b8c6e253886c281 /release | |
parent | 1393045356076e418367091372b6861b907f0222 (diff) | |
download | FreeBSD-src-0c8c98d14ef26be4fb8eb751587566399b622d67.zip FreeBSD-src-0c8c98d14ef26be4fb8eb751587566399b622d67.tar.gz |
generate multiple host keys and do that unconditionally
Diffstat (limited to 'release')
-rwxr-xr-x | release/picobsd/build/picobsd | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/release/picobsd/build/picobsd b/release/picobsd/build/picobsd index 8338bd6..fa8e90c 100755 --- a/release/picobsd/build/picobsd +++ b/release/picobsd/build/picobsd @@ -693,17 +693,22 @@ populate_mfs_tree() { # rm $a # do not remove! ) || fail $? crunch - if [ -f ${dst}/stand/sshd ] ; then - log "Setting up host key for sshd:" - if [ -f ${BUILDDIR}/floppy.tree/etc/ssh_host_key.gz ] ; then - log "Using existing host key" + log "Setting up host key for sshd:" + for K in rsa1 rsa dsa ; do + if [ $K = rsa1 ] ; then + i=ssh_host_key else - log "Generating new host key" - ssh-keygen -t rsa1 -f ${BUILDDIR}/floppy.tree/etc/ssh_host_key \ - -N "" -C "root@picobsd" - gzip -9 ${BUILDDIR}/floppy.tree/etc/ssh_host_key* || true + i=ssh_host_${K}_key fi - fi + if [ -f ${BUILDDIR}/floppy.tree/etc/$i.gz ] ; then + log "Using existing host key $i" + else + log "Generating new host key $i" + ssh-keygen -t $K -f ${BUILDDIR}/floppy.tree/etc/$i \ + -N "" -C "root@picobsd" + gzip -9 ${BUILDDIR}/floppy.tree/etc/${i}* || true + fi + done log "Copy generic and site-specific MFS tree..." for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do |