summaryrefslogtreecommitdiff
path: root/contrib/cygwin/ssh-host-config
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-11-09 00:19:22 +1100
committerDarren Tucker <dtucker@zip.com.au>2013-11-09 00:19:22 +1100
commitaff7ef1bb8b7c1eeb1f4812129091c5adbf51848 (patch)
tree96ba9aafa62cd81bf18c108179b8619b6989c98e /contrib/cygwin/ssh-host-config
parent882abfd3fb3c98cfe70b4fc79224770468b570a5 (diff)
- (dtucker) [contrib/cygwin/ssh-host-config] Simplify host key generation:
rather than testing and generating each key, call ssh-keygen -A. Patch from vinschen at redhat.com.
Diffstat (limited to 'contrib/cygwin/ssh-host-config')
-rw-r--r--contrib/cygwin/ssh-host-config52
1 files changed, 2 insertions, 50 deletions
diff --git a/contrib/cygwin/ssh-host-config b/contrib/cygwin/ssh-host-config
index c542d5cb6..05efd3b3b 100644
--- a/contrib/cygwin/ssh-host-config
+++ b/contrib/cygwin/ssh-host-config
@@ -68,54 +68,6 @@ password_value=
68opt_force=no 68opt_force=no
69 69
70# ====================================================================== 70# ======================================================================
71# Routine: create_host_keys
72# ======================================================================
73create_host_keys() {
74 local ret=0
75
76 if [ ! -f "${SYSCONFDIR}/ssh_host_key" ]
77 then
78 csih_inform "Generating ${SYSCONFDIR}/ssh_host_key"
79 if ! /usr/bin/ssh-keygen -t rsa1 -f ${SYSCONFDIR}/ssh_host_key -N '' > /dev/null
80 then
81 csih_warning "Generating ${SYSCONFDIR}/ssh_host_key failed!"
82 let ++ret
83 fi
84 fi
85
86 if [ ! -f "${SYSCONFDIR}/ssh_host_rsa_key" ]
87 then
88 csih_inform "Generating ${SYSCONFDIR}/ssh_host_rsa_key"
89 if ! /usr/bin/ssh-keygen -t rsa -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' > /dev/null
90 then
91 csih_warning "Generating ${SYSCONFDIR}/ssh_host_key failed!"
92 let ++ret
93 fi
94 fi
95
96 if [ ! -f "${SYSCONFDIR}/ssh_host_dsa_key" ]
97 then
98 csih_inform "Generating ${SYSCONFDIR}/ssh_host_dsa_key"
99 if ! /usr/bin/ssh-keygen -t dsa -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' > /dev/null
100 then
101 csih_warning "Generating ${SYSCONFDIR}/ssh_host_key failed!"
102 let ++ret
103 fi
104 fi
105
106 if [ ! -f "${SYSCONFDIR}/ssh_host_ecdsa_key" ]
107 then
108 csih_inform "Generating ${SYSCONFDIR}/ssh_host_ecdsa_key"
109 if ! /usr/bin/ssh-keygen -t ecdsa -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' > /dev/null
110 then
111 csih_warning "Generating ${SYSCONFDIR}/ssh_host_key failed!"
112 let ++ret
113 fi
114 fi
115 return $ret
116} # --- End of create_host_keys --- #
117
118# ======================================================================
119# Routine: update_services_file 71# Routine: update_services_file
120# ====================================================================== 72# ======================================================================
121update_services_file() { 73update_services_file() {
@@ -719,8 +671,8 @@ then
719 let ++warning_cnt 671 let ++warning_cnt
720fi 672fi
721 673
722# host keys 674# generate missing host keys
723create_host_keys || let warning_cnt+=$? 675/usr/bin/ssh-keygen -A || let warning_cnt+=$?
724 676
725# handle ssh_config 677# handle ssh_config
726csih_install_config "${SYSCONFDIR}/ssh_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt 678csih_install_config "${SYSCONFDIR}/ssh_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt