3 # $NetBSD: sshd,v 1.18 2002/04/29 08:23:34 lukem Exp $
9 # KEYWORD: FreeBSD NetBSD
15 command="/usr/sbin/${name}"
16 keygen_cmd="sshd_keygen"
17 start_precmd="sshd_precmd"
18 pidfile="/var/run/${name}.pid"
19 required_files="/etc/ssh/sshd_config"
20 extra_commands="keygen reload"
27 # Can't do anything if ssh is not installed
28 [ -x /usr/bin/ssh-keygen ] || {
29 warn "/usr/bin/ssh-keygen does not exist."
33 if [ -f /etc/ssh/ssh_host_key ]; then
34 echo "You already have an RSA host key" \
35 "in /etc/ssh/ssh_host_key"
36 echo "Skipping protocol version 1 RSA Key Generation"
38 /usr/bin/ssh-keygen -t rsa1 -b 1024 \
39 -f /etc/ssh/ssh_host_key -N ''
42 if [ -f /etc/ssh/ssh_host_dsa_key ]; then
43 echo "You already have a DSA host key" \
44 "in /etc/ssh/ssh_host_dsa_key"
45 echo "Skipping protocol version 2 DSA Key Generation"
47 /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
50 if [ -f /etc/ssh/ssh_host_rsa_key ]; then
51 echo "You already have a RSA host key" \
52 "in /etc/ssh/ssh_host_rsa_key"
53 echo "Skipping protocol version 2 RSA Key Generation"
55 /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
62 if [ ! -f /etc/ssh/ssh_host_key -o \
63 ! -f /etc/ssh/ssh_host_dsa_key -o \
64 ! -f /etc/ssh/ssh_host_rsa_key ]; then