generate multiple host keys and do that unconditionally

This commit is contained in:
Luigi Rizzo 2013-09-06 17:18:43 +00:00
parent d3d4b31dd4
commit c58e667d47
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255314

View file

@ -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