Annotation of elwix/config/etc/default/rc.d/022.sshd.run, revision 1.1
1.1 ! misho 1: #!/bin/sh
! 2:
! 3: CONFDIR="/etc/ssh"
! 4: CONFIG="${CONFDIR}/sshd_config"
! 5:
! 6: sshd_keygen()
! 7: {
! 8: echo "Starting SSH ..."
! 9: (
! 10: umask 022
! 11: if [ -f ${CONFDIR}/ssh_host_key ]; then
! 12: echo "You already have an RSA host key in ${CONFDIR}/ssh_host_key"
! 13: echo "Skipping protocol version 1 RSA Key Generation"
! 14: else
! 15: echo "Generating SSH version 1 RSA host key..."
! 16: /usr/bin/ssh-keygen -t rsa1 -f ${CONFDIR}/ssh_host_key -N '' 1>/dev/null 2>&1
! 17: fi
! 18:
! 19: if [ -f ${CONFDIR}/ssh_host_dsa_key ]; then
! 20: echo "You already have a DSA host key in ${CONFDIR}/ssh_host_dsa_key"
! 21: echo "Skipping protocol version 2 DSA Key Generation"
! 22: else
! 23: echo "Generating SSH DSA host key..."
! 24: /usr/bin/ssh-keygen -t dsa -f ${CONFDIR}/ssh_host_dsa_key -N '' 1>/dev/null 2>&1
! 25: fi
! 26:
! 27: if [ -f ${CONFDIR}/ssh_host_rsa_key ]; then
! 28: echo "You already have a RSA host key in ${CONFDIR}/ssh_host_rsa_key"
! 29: echo "Skipping protocol version 2 RSA Key Generation"
! 30: else
! 31: echo "Generating SSH version 2 RSA key ..."
! 32: /usr/bin/ssh-keygen -t rsa -f ${CONFDIR}/ssh_host_rsa_key -N '' 1>/dev/null 2>&1
! 33: fi
! 34: )
! 35: }
! 36:
! 37: if [ ! -f /etc/ssh/ssh_host_key -o \
! 38: ! -f /etc/ssh/ssh_host_dsa_key -o \
! 39: ! -f /etc/ssh/ssh_host_rsa_key ]; then
! 40: echo "Creating SSH Keys ..."
! 41: sshd_keygen
! 42: fi
! 43:
! 44: /usr/sbin/sshd -f $CONFIG
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>