Deleted Added
full compact
sshd (180564) sshd (221420)
1#!/bin/sh
2#
1#!/bin/sh
2#
3# $FreeBSD: head/etc/rc.d/sshd 180564 2008-07-16 19:50:29Z dougb $
3# $FreeBSD: head/etc/rc.d/sshd 221420 2011-05-04 07:34:44Z des $
4#
5
6# PROVIDE: sshd
7# REQUIRE: LOGIN cleanvar
8# KEYWORD: shutdown
9
10. /etc/rc.subr
11

--- 53 unchanged lines hidden (view full) ---

65 echo "You already have a DSA host key" \
66 "in /etc/ssh/ssh_host_dsa_key"
67 echo "Skipping protocol version 2 DSA Key Generation"
68 else
69 /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
70 fi
71
72 if [ -f /etc/ssh/ssh_host_rsa_key ]; then
4#
5
6# PROVIDE: sshd
7# REQUIRE: LOGIN cleanvar
8# KEYWORD: shutdown
9
10. /etc/rc.subr
11

--- 53 unchanged lines hidden (view full) ---

65 echo "You already have a DSA host key" \
66 "in /etc/ssh/ssh_host_dsa_key"
67 echo "Skipping protocol version 2 DSA Key Generation"
68 else
69 /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
70 fi
71
72 if [ -f /etc/ssh/ssh_host_rsa_key ]; then
73 echo "You already have a RSA host key" \
73 echo "You already have an RSA host key" \
74 "in /etc/ssh/ssh_host_rsa_key"
75 echo "Skipping protocol version 2 RSA Key Generation"
76 else
77 /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
78 fi
74 "in /etc/ssh/ssh_host_rsa_key"
75 echo "Skipping protocol version 2 RSA Key Generation"
76 else
77 /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
78 fi
79
80 if [ -f /etc/ssh/ssh_host_ecdsa_key ]; then
81 echo "You already have an ECDSA host key" \
82 "in /etc/ssh/ssh_host_ecdsa_key"
83 echo "Skipping protocol version 2 ECDSA Key Generation"
84 else
85 /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
86 fi
79 )
80}
81
82sshd_precmd()
83{
84 if [ ! -f /etc/ssh/ssh_host_key -o \
85 ! -f /etc/ssh/ssh_host_dsa_key -o \
87 )
88}
89
90sshd_precmd()
91{
92 if [ ! -f /etc/ssh/ssh_host_key -o \
93 ! -f /etc/ssh/ssh_host_dsa_key -o \
94 ! -f /etc/ssh/ssh_host_ecdsa_key -o \
86 ! -f /etc/ssh/ssh_host_rsa_key ]; then
87 user_reseed
88 run_rc_command keygen
89 fi
90}
91
92load_rc_config $name
93run_rc_command "$1"
95 ! -f /etc/ssh/ssh_host_rsa_key ]; then
96 user_reseed
97 run_rc_command keygen
98 fi
99}
100
101load_rc_config $name
102run_rc_command "$1"