summaryrefslogtreecommitdiff
path: root/contrib/redhat/sshd.init
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/redhat/sshd.init')
-rwxr-xr-xcontrib/redhat/sshd.init27
1 files changed, 21 insertions, 6 deletions
diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init
index 41f98ad88..a4df64276 100755
--- a/contrib/redhat/sshd.init
+++ b/contrib/redhat/sshd.init
@@ -19,13 +19,27 @@ RETVAL=0
19 19
20# Some functions to make the below more readable 20# Some functions to make the below more readable
21KEYGEN=/usr/bin/ssh-keygen 21KEYGEN=/usr/bin/ssh-keygen
22RSA_KEY=/etc/ssh/ssh_host_key 22RSA1_KEY=/etc/ssh/ssh_host_key
23RSA_KEY=/etc/ssh/ssh_host_rsa_key
23DSA_KEY=/etc/ssh/ssh_host_dsa_key 24DSA_KEY=/etc/ssh/ssh_host_dsa_key
24PID_FILE=/var/run/sshd.pid 25PID_FILE=/var/run/sshd.pid
26do_rsa1_keygen() {
27 if ! test -f $RSA1_KEY ; then
28 echo -n "Generating SSH1 RSA host key: "
29 if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
30 success "RSA1 key generation"
31 echo
32 else
33 failure "RSA1 key generation"
34 echo
35 exit 1
36 fi
37 fi
38}
25do_rsa_keygen() { 39do_rsa_keygen() {
26 if $KEYGEN -R && ! test -f $RSA_KEY ; then 40 if ! test -f $RSA_KEY ; then
27 echo -n "Generating SSH RSA host key: " 41 echo -n "Generating SSH2 RSA host key: "
28 if $KEYGEN -q -b 1024 -f $RSA_KEY -C '' -N '' >&/dev/null; then 42 if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then
29 success "RSA key generation" 43 success "RSA key generation"
30 echo 44 echo
31 else 45 else
@@ -37,8 +51,8 @@ do_rsa_keygen() {
37} 51}
38do_dsa_keygen() { 52do_dsa_keygen() {
39 if ! test -f $DSA_KEY ; then 53 if ! test -f $DSA_KEY ; then
40 echo -n "Generating SSH DSA host key: " 54 echo -n "Generating SSH2 DSA host key: "
41 if $KEYGEN -q -d -b 1024 -f $DSA_KEY -C '' -N '' >&/dev/null; then 55 if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then
42 success "DSA key generation" 56 success "DSA key generation"
43 echo 57 echo
44 else 58 else
@@ -52,6 +66,7 @@ do_dsa_keygen() {
52case "$1" in 66case "$1" in
53 start) 67 start)
54 # Create keys if necessary 68 # Create keys if necessary
69 do_rsa1_keygen;
55 do_rsa_keygen; 70 do_rsa_keygen;
56 do_dsa_keygen; 71 do_dsa_keygen;
57 72