summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--contrib/cygwin/ssh-host-config6
-rw-r--r--contrib/cygwin/ssh-user-config84
3 files changed, 25 insertions, 67 deletions
diff --git a/ChangeLog b/ChangeLog
index 5af606b4d..3fa2f4534 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
120110206 120110206
2 - (dtucker) [openbsd-compat/port-linux.c] Bug #1851: fix syntax error in 2 - (dtucker) [openbsd-compat/port-linux.c] Bug #1851: fix syntax error in
3 selinux code. Patch from Leonardo Chiquitto 3 selinux code. Patch from Leonardo Chiquitto
4 - (dtucker) [contrib/cygwin/ssh-{host,user}-config] Add ECDSA key
5 generation and simplify. Patch from Corinna Vinschen.
4 6
520110204 720110204
6 - OpenBSD CVS Sync 8 - OpenBSD CVS Sync
diff --git a/contrib/cygwin/ssh-host-config b/contrib/cygwin/ssh-host-config
index d968d4619..0af6907dc 100644
--- a/contrib/cygwin/ssh-host-config
+++ b/contrib/cygwin/ssh-host-config
@@ -63,6 +63,12 @@ create_host_keys() {
63 csih_inform "Generating ${SYSCONFDIR}/ssh_host_dsa_key" 63 csih_inform "Generating ${SYSCONFDIR}/ssh_host_dsa_key"
64 ssh-keygen -t dsa -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' > /dev/null 64 ssh-keygen -t dsa -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' > /dev/null
65 fi 65 fi
66
67 if [ ! -f "${SYSCONFDIR}/ssh_host_ecdsa_key" ]
68 then
69 csih_inform "Generating ${SYSCONFDIR}/ssh_host_ecdsa_key"
70 ssh-keygen -t ecdsa -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' > /dev/null
71 fi
66} # --- End of create_host_keys --- # 72} # --- End of create_host_keys --- #
67 73
68# ====================================================================== 74# ======================================================================
diff --git a/contrib/cygwin/ssh-user-config b/contrib/cygwin/ssh-user-config
index f1a001a93..027ae6032 100644
--- a/contrib/cygwin/ssh-user-config
+++ b/contrib/cygwin/ssh-user-config
@@ -39,85 +39,34 @@ pwdhome=
39with_passphrase= 39with_passphrase=
40 40
41# ====================================================================== 41# ======================================================================
42# Routine: create_ssh1_identity 42# Routine: create_identity
43# optionally create ~/.ssh/identity[.pub] 43# optionally create identity of type argument in ~/.ssh
44# optionally add result to ~/.ssh/authorized_keys 44# optionally add result to ~/.ssh/authorized_keys
45# ====================================================================== 45# ======================================================================
46create_ssh1_identity() { 46create_identity() {
47 if [ ! -f "${pwdhome}/.ssh/identity" ] 47 local file="$1"
48 local type="$2"
49 local name="$3"
50 if [ ! -f "${pwdhome}/.ssh/${file}" ]
48 then 51 then
49 if csih_request "Shall I create an SSH1 RSA identity file for you?" 52 if csih_request "Shall I create a ${name} identity file for you?"
50 then 53 then
51 csih_inform "Generating ${pwdhome}/.ssh/identity" 54 csih_inform "Generating ${pwdhome}/.ssh/${file}"
52 if [ "${with_passphrase}" = "yes" ] 55 if [ "${with_passphrase}" = "yes" ]
53 then 56 then
54 ssh-keygen -t rsa1 -N "${passphrase}" -f "${pwdhome}/.ssh/identity" > /dev/null 57 ssh-keygen -t "${type}" -N "${passphrase}" -f "${pwdhome}/.ssh/${file}" > /dev/null
55 else 58 else
56 ssh-keygen -t rsa1 -f "${pwdhome}/.ssh/identity" > /dev/null 59 ssh-keygen -t "${type}" -f "${pwdhome}/.ssh/${file}" > /dev/null
57 fi 60 fi
58 if csih_request "Do you want to use this identity to login to this machine?" 61 if csih_request "Do you want to use this identity to login to this machine?"
59 then 62 then
60 csih_inform "Adding to ${pwdhome}/.ssh/authorized_keys" 63 csih_inform "Adding to ${pwdhome}/.ssh/authorized_keys"
61 cat "${pwdhome}/.ssh/identity.pub" >> "${pwdhome}/.ssh/authorized_keys" 64 cat "${pwdhome}/.ssh/${file}.pub" >> "${pwdhome}/.ssh/authorized_keys"
62 fi 65 fi
63 fi 66 fi
64 fi 67 fi
65} # === End of create_ssh1_identity() === # 68} # === End of create_ssh1_identity() === #
66readonly -f create_ssh1_identity 69readonly -f create_identity
67
68# ======================================================================
69# Routine: create_ssh2_rsa_identity
70# optionally create ~/.ssh/id_rsa[.pub]
71# optionally add result to ~/.ssh/authorized_keys
72# ======================================================================
73create_ssh2_rsa_identity() {
74 if [ ! -f "${pwdhome}/.ssh/id_rsa" ]
75 then
76 if csih_request "Shall I create an SSH2 RSA identity file for you?"
77 then
78 csih_inform "Generating ${pwdhome}/.ssh/id_rsa"
79 if [ "${with_passphrase}" = "yes" ]
80 then
81 ssh-keygen -t rsa -N "${passphrase}" -f "${pwdhome}/.ssh/id_rsa" > /dev/null
82 else
83 ssh-keygen -t rsa -f "${pwdhome}/.ssh/id_rsa" > /dev/null
84 fi
85 if csih_request "Do you want to use this identity to login to this machine?"
86 then
87 csih_inform "Adding to ${pwdhome}/.ssh/authorized_keys"
88 cat "${pwdhome}/.ssh/id_rsa.pub" >> "${pwdhome}/.ssh/authorized_keys"
89 fi
90 fi
91 fi
92} # === End of create_ssh2_rsa_identity() === #
93readonly -f create_ssh2_rsa_identity
94
95# ======================================================================
96# Routine: create_ssh2_dsa_identity
97# optionally create ~/.ssh/id_dsa[.pub]
98# optionally add result to ~/.ssh/authorized_keys
99# ======================================================================
100create_ssh2_dsa_identity() {
101 if [ ! -f "${pwdhome}/.ssh/id_dsa" ]
102 then
103 if csih_request "Shall I create an SSH2 DSA identity file for you?"
104 then
105 csih_inform "Generating ${pwdhome}/.ssh/id_dsa"
106 if [ "${with_passphrase}" = "yes" ]
107 then
108 ssh-keygen -t dsa -N "${passphrase}" -f "${pwdhome}/.ssh/id_dsa" > /dev/null
109 else
110 ssh-keygen -t dsa -f "${pwdhome}/.ssh/id_dsa" > /dev/null
111 fi
112 if csih_request "Do you want to use this identity to login to this machine?"
113 then
114 csih_inform "Adding to ${pwdhome}/.ssh/authorized_keys"
115 cat "${pwdhome}/.ssh/id_dsa.pub" >> "${pwdhome}/.ssh/authorized_keys"
116 fi
117 fi
118 fi
119} # === End of create_ssh2_dsa_identity() === #
120readonly -f create_ssh2_dsa_identity
121 70
122# ====================================================================== 71# ======================================================================
123# Routine: check_user_homedir 72# Routine: check_user_homedir
@@ -311,9 +260,10 @@ fi
311 260
312check_user_homedir 261check_user_homedir
313check_user_dot_ssh_dir 262check_user_dot_ssh_dir
314create_ssh1_identity 263create_identity id_rsa rsa "SSH2 RSA"
315create_ssh2_rsa_identity 264create_identity id_dsa dsa "SSH2 DSA"
316create_ssh2_dsa_identity 265create_identity id_ecdsa ecdsa "SSH2 ECDSA"
266create_identity identity rsa1 "(deprecated) SSH1 RSA"
317fix_authorized_keys_perms 267fix_authorized_keys_perms
318 268
319echo 269echo