3 # $NetBSD: sshd,v 1.19 2004/02/18 17:36:34 jonb Exp $
9 $_rc_subr_loaded .
/etc
/rc.subr
13 command="/usr/sbin/${name}"
14 pidfile
="/var/run/${name}.pid"
15 required_files
="/etc/ssh/sshd_config"
16 extra_commands
="keygen reload"
22 if [ -f /etc
/ssh
/ssh_host_key
]; then
23 echo "You already have an RSA host key" \
24 "in /etc/ssh/ssh_host_key"
25 echo "Skipping protocol version 1 RSA Key Generation"
27 /usr
/bin
/ssh-keygen
-t rsa1
${ssh_keygen_flags} \
28 -f /etc
/ssh
/ssh_host_key
-N ''
31 if [ -f /etc
/ssh
/ssh_host_dsa_key
]; then
32 echo "You already have a DSA host key" \
33 "in /etc/ssh/ssh_host_dsa_key"
34 echo "Skipping protocol version 2 DSA Key Generation"
36 /usr
/bin
/ssh-keygen
-t dsa
${ssh_keygen_flags} \
37 -f /etc
/ssh
/ssh_host_dsa_key
-N ''
40 if [ -f /etc
/ssh
/ssh_host_rsa_key
]; then
41 echo "You already have a RSA host key" \
42 "in /etc/ssh/ssh_host_rsa_key"
43 echo "Skipping protocol version 2 RSA Key Generation"
45 /usr
/bin
/ssh-keygen
-t rsa
${ssh_keygen_flags} \
46 -f /etc
/ssh
/ssh_host_rsa_key
-N ''
53 if [ ! -f /etc
/ssh
/ssh_host_key
-o \
54 ! -f /etc
/ssh
/ssh_host_dsa_key
-o \
55 ! -f /etc
/ssh
/ssh_host_rsa_key
]; then
60 keygen_cmd
=sshd_keygen
61 start_precmd
=sshd_precmd