summaryrefslogtreecommitdiff
path: root/contrib/cygwin
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2000-10-29 19:18:49 +0000
committerKevin Steves <stevesk@pobox.com>2000-10-29 19:18:49 +0000
commit9be6e267b5769f0783fdb83b38a19418c6bd83d1 (patch)
treea6dfab93daa096c6e60c1a0b5ef1e42fcb5db5ee /contrib/cygwin
parenta58e0af1bd608c94314821d050d0c31c1484e490 (diff)
- (stevesk) Create contrib/cygwin/ directory; patch from
Corinna Vinschen <vinschen@redhat.com>
Diffstat (limited to 'contrib/cygwin')
-rw-r--r--contrib/cygwin/README137
-rwxr-xr-xcontrib/cygwin/ssh-config324
2 files changed, 461 insertions, 0 deletions
diff --git a/contrib/cygwin/README b/contrib/cygwin/README
new file mode 100644
index 000000000..8c9d0bb73
--- /dev/null
+++ b/contrib/cygwin/README
@@ -0,0 +1,137 @@
1This package is the actual port of OpenSSH to Cygwin 1.1.
2
3===========================================================================
4Important change since 2.3.0p1:
5
6When using `ntea' or `ntsec' you now have to care for the ownership
7and permission bits of your host key files and your private key files.
8The host key files have to be owned by the NT account which starts
9sshd. The user key files have to be owned by the user. The permission
10bits of the private key files (host and user) have to be at least
11rw------- (0600)!
12
13Note that this is forced under `ntsec' only if the files are on a NTFS
14filesystem (which is recommended) due to the lack of any basic security
15features of the FAT/FAT32 filesystems.
16===========================================================================
17
18Since this package is part of the base distribution now, the location
19of the files has changed from /usr/local to /usr. The global configuration
20files are in /etc now.
21
22If you are installing OpenSSH the first time, you can generate
23global config files, server keys and your own user keys by running
24
25 /usr/bin/ssh-config
26
27If you are updating your installation you may run the above ssh-config
28as well to move your configuration files to the new location and to
29erase the files at the old location.
30
31Be sure to start the new ssh-config when updating!
32
33Note that this binary archive doesn't contain default config files in /etc.
34That files are only created if ssh-config is started.
35
36Install sshd as daemon via SRVANY.EXE (recommended on NT/W2K), via inetd
37(results in very slow deamon startup!) or from the command line (recommended
38on 9X/ME).
39
40If starting via inetd, copy sshd to eg. /usr/sbin/in.sshd and add the
41following line to your inetd.conf file:
42
43sshd stream tcp nowait root /usr/sbin/in.sshd sshd -i
44
45Moreover you'll have to add the following line to your
46${SYSTEMROOT}/system32/drivers/etc/services file:
47
48 sshd 22/tcp #SSH daemon
49
50Authentication to sshd is possible in one of two ways.
51You'll have to decide before starting sshd!
52
53- If you want to authenticate via RSA and you want to login to that
54 machine to exactly one user account you can do so by running sshd
55 under that user account. You must change /etc/sshd_config
56 to contain the following:
57
58 RSAAuthentication yes
59
60 Moreover it's possible to use rhosts and/or rhosts with
61 RSA authentication by setting the following in sshd_config:
62
63 RhostsAuthentication yes
64 RhostsRSAAuthentication yes
65
66- If you want to be able to login to different user accounts you'll
67 have to start sshd under system account or any other account that
68 is able to switch user context. Note that administrators are _not_
69 able to do that by default! You'll have to give the following
70 special user rights to the user:
71 "Act as part of the operating system"
72 "Replace process level token"
73 "Increase quotas"
74 and if used via service manager
75 "Logon as a service".
76
77 The system account does of course own that user rights by default.
78
79 Unfortunately, if you choose that way, you can only logon with
80 NT password authentification and you should change
81 /etc/sshd_config to contain the following:
82
83 PasswordAuthentication yes
84 RhostsAuthentication no
85 RhostsRSAAuthentication no
86 RSAAuthentication no
87
88 However you can login to the user which has started sshd with
89 RSA authentication anyway. If you want that, change the RSA
90 authentication setting back to "yes":
91
92 RSAAuthentication yes
93
94You may use all features of the CYGWIN=ntsec setting the same
95way as they are used by the `login' port on sources.redhat.com:
96
97 The pw_gecos field may contain an additional field, that begins
98 with (upper case!) "U-", followed by the domain and the username
99 separated by a backslash.
100 CAUTION: The SID _must_ remain the _last_ field in pw_gecos!
101 BTW: The field separator in pw_gecos is the comma.
102 The username in pw_name itself may be any nice name:
103
104 domuser::1104:513:John Doe,U-domain\user,S-1-5-21-...
105
106 Now you may use `domuser' as your login name with telnet!
107 This is possible additionally for local users, if you don't like
108 your NT login name ;-) You only have to leave out the domain:
109
110 locuser::1104:513:John Doe,U-user,S-1-5-21-...
111
112V2 server and user keys are generated by `ssh-config'. If you want to
113create DSA keys by yourself, call ssh-keygen with `-d' option.
114
115DSA authentication similar to RSA:
116 Add keys to ~/.ssh/authorized_keys2
117Interop. w/ ssh.com dsa-keys:
118 ssh-keygen -f /key/from/ssh.com -X >> ~/.ssh/authorized_keys2
119and vice versa:
120 ssh-keygen -f /privatekey/from/openssh -x > ~/.ssh2/mykey.pub
121 echo Key mykey.pub >> ~/.ssh2/authorization
122
123If you want to build from source, the following options to
124configure are used for the Cygwin binary distribution:
125
126--prefix=/usr --sysconfdir=/etc --libexecdir='${exec_prefix}/sbin
127
128You must have installed the zlib, openssl and regex packages to
129be able to build OpenSSH!
130
131Please send requests, error reports etc. to cygwin@sources.redhat.com.
132
133Have fun,
134
135Corinna Vinschen <vinschen@cygnus.com>
136Cygwin Developer
137Red Hat Inc.
diff --git a/contrib/cygwin/ssh-config b/contrib/cygwin/ssh-config
new file mode 100755
index 000000000..20c8cceb0
--- /dev/null
+++ b/contrib/cygwin/ssh-config
@@ -0,0 +1,324 @@
1#!/bin/sh
2#
3# ssh-config, Copyright 2000, Red Hat Inc.
4#
5# This file is part of the Cygwin port of OpenSSH.
6
7# set -x
8
9# Subdirectory where the new package is being installed
10PREFIX=/usr
11
12# Directory where the config files are stored
13SYSCONFDIR=/etc
14
15# Subdirectory where an old package might be installed
16OLDPREFIX=/usr/local
17OLDSYSCONFDIR=${OLDPREFIX}/etc
18
19request()
20{
21 answer=""
22 while [ "X${answer}" != "Xyes" -a "X${answer}" != "Xno" ]
23 do
24 echo -n "$1 (yes/no) "
25 read answer
26 done
27 if [ "X${answer}" = "Xyes" ]
28 then
29 return 0
30 else
31 return 1
32 fi
33}
34
35# Check for running ssh/sshd processes first. Refuse to do anything while
36# some ssh processes are still running
37
38if ps -ef | grep -v grep | grep -q ssh
39then
40 echo
41 echo "There are still ssh processes running. Please shut them down first."
42 echo
43 exit 1
44fi
45
46# Check for ${SYSCONFDIR} directory
47
48if [ -e "${SYSCONFDIR}" -a ! -d "${SYSCONFDIR}" ]
49then
50 echo
51 echo "${SYSCONFDIR} is existant but not a directory."
52 echo "Cannot create global configuration files."
53 echo
54 exit 1
55fi
56
57# Create it if necessary
58
59if [ ! -e "${SYSCONFDIR}" ]
60then
61 mkdir "${SYSCONFDIR}"
62 if [ ! -e "${SYSCONFDIR}" ]
63 then
64 echo
65 echo "Creating ${SYSCONFDIR} directory failed"
66 echo
67 exit 1
68 fi
69fi
70
71# Check for an old installation in ${OLDPREFIX} unless ${OLDPREFIX} isn't
72# the same as ${PREFIX}
73
74if [ "${OLDPREFIX}" != "${PREFIX}" ]
75then
76 if [ -f "${OLDPREFIX}/sbin/sshd" ]
77 then
78 echo
79 echo "You seem to have an older installation in ${OLDPREFIX}."
80 echo
81 # Check if old global configuration files exist
82 if [ -f "${OLDSYSCONFDIR}/ssh_host_key" ]
83 then
84 if request "Do you want to copy your config files to your new installation?"
85 then
86 cp -f ${OLDSYSCONFDIR}/ssh_host_key ${SYSCONFDIR}
87 cp -f ${OLDSYSCONFDIR}/ssh_host_key.pub ${SYSCONFDIR}
88 cp -f ${OLDSYSCONFDIR}/ssh_host_dsa_key ${SYSCONFDIR}
89 cp -f ${OLDSYSCONFDIR}/ssh_host_dsa_key.pub ${SYSCONFDIR}
90 cp -f ${OLDSYSCONFDIR}/ssh_config ${SYSCONFDIR}
91 cp -f ${OLDSYSCONFDIR}/sshd_config ${SYSCONFDIR}
92 fi
93 fi
94 if request "Do you want to erase your old installation?"
95 then
96 rm -f ${OLDPREFIX}/bin/ssh.exe
97 rm -f ${OLDPREFIX}/bin/ssh-config
98 rm -f ${OLDPREFIX}/bin/scp.exe
99 rm -f ${OLDPREFIX}/bin/ssh-add.exe
100 rm -f ${OLDPREFIX}/bin/ssh-agent.exe
101 rm -f ${OLDPREFIX}/bin/ssh-keygen.exe
102 rm -f ${OLDPREFIX}/bin/slogin
103 rm -f ${OLDSYSCONFDIR}/ssh_host_key
104 rm -f ${OLDSYSCONFDIR}/ssh_host_key.pub
105 rm -f ${OLDSYSCONFDIR}/ssh_host_dsa_key
106 rm -f ${OLDSYSCONFDIR}/ssh_host_dsa_key.pub
107 rm -f ${OLDSYSCONFDIR}/ssh_config
108 rm -f ${OLDSYSCONFDIR}/sshd_config
109 rm -f ${OLDPREFIX}/man/man1/ssh.1
110 rm -f ${OLDPREFIX}/man/man1/scp.1
111 rm -f ${OLDPREFIX}/man/man1/ssh-add.1
112 rm -f ${OLDPREFIX}/man/man1/ssh-agent.1
113 rm -f ${OLDPREFIX}/man/man1/ssh-keygen.1
114 rm -f ${OLDPREFIX}/man/man1/slogin.1
115 rm -f ${OLDPREFIX}/man/man8/sshd.8
116 rm -f ${OLDPREFIX}/sbin/sshd.exe
117 rm -f ${OLDPREFIX}/sbin/sftp-server.exe
118 fi
119 fi
120fi
121
122# First generate host keys if not already existing
123
124if [ ! -f "${SYSCONFDIR}/ssh_host_key" ]
125then
126 echo "Generating ${SYSCONFDIR}/ssh_host_key"
127 ssh-keygen -f ${SYSCONFDIR}/ssh_host_key -N ''
128fi
129
130if [ ! -f "${SYSCONFDIR}/ssh_host_dsa_key" ]
131then
132 echo "Generating ${SYSCONFDIR}/ssh_host_dsa_key"
133 ssh-keygen -d -f ${SYSCONFDIR}/ssh_host_dsa_key -N ''
134fi
135
136# Check if ssh_config exists. If yes, ask for overwriting
137
138if [ -f "${SYSCONFDIR}/ssh_config" ]
139then
140 if request "Overwrite existing ${SYSCONFDIR}/ssh_config file?"
141 then
142 rm -f "${SYSCONFDIR}/ssh_config"
143 if [ -f "${SYSCONFDIR}/ssh_config" ]
144 then
145 echo "Can't overwrite. ${SYSCONFDIR}/ssh_config is write protected."
146 fi
147 fi
148fi
149
150# Create default ssh_config from here script
151
152if [ ! -f "${SYSCONFDIR}/ssh_config" ]
153then
154 echo "Creating default ${SYSCONFDIR}/ssh_config file"
155 cat > ${SYSCONFDIR}/ssh_config << EOF
156# This is ssh client systemwide configuration file. This file provides
157# defaults for users, and the values can be changed in per-user configuration
158# files or on the command line.
159
160# Configuration data is parsed as follows:
161# 1. command line options
162# 2. user-specific file
163# 3. system-wide file
164# Any configuration value is only changed the first time it is set.
165# Thus, host-specific definitions should be at the beginning of the
166# configuration file, and defaults at the end.
167
168# Site-wide defaults for various options
169
170# Host *
171# ForwardAgent yes
172# ForwardX11 yes
173# RhostsAuthentication yes
174# RhostsRSAAuthentication yes
175# RSAAuthentication yes
176# PasswordAuthentication yes
177# FallBackToRsh no
178# UseRsh no
179# BatchMode no
180# CheckHostIP yes
181# StrictHostKeyChecking no
182# IdentityFile ~/.ssh/identity
183# Port 22
184# Protocol 2,1
185# Cipher 3des
186# EscapeChar ~
187
188# Be paranoid by default
189Host *
190 ForwardAgent no
191 ForwardX11 no
192 FallBackToRsh no
193EOF
194fi
195
196# Check if sshd_config exists. If yes, ask for overwriting
197
198if [ -f "${SYSCONFDIR}/sshd_config" ]
199then
200 if request "Overwrite existing ${SYSCONFDIR}/sshd_config file?"
201 then
202 rm -f "${SYSCONFDIR}/sshd_config"
203 if [ -f "${SYSCONFDIR}/sshd_config" ]
204 then
205 echo "Can't overwrite. ${SYSCONFDIR}/sshd_config is write protected."
206 fi
207 fi
208fi
209
210# Create default sshd_config from here script
211
212if [ ! -f "${SYSCONFDIR}/sshd_config" ]
213then
214 echo "Creating default ${SYSCONFDIR}/sshd_config file"
215 cat > ${SYSCONFDIR}/sshd_config << EOF
216# This is ssh server systemwide configuration file.
217
218Port 22
219#Protocol 2,1
220ListenAddress 0.0.0.0
221#ListenAddress ::
222#HostKey /etc/ssh_host_key
223ServerKeyBits 768
224LoginGraceTime 600
225KeyRegenerationInterval 3600
226PermitRootLogin yes
227#
228# Don't read ~/.rhosts and ~/.shosts files
229IgnoreRhosts yes
230# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
231#IgnoreUserKnownHosts yes
232StrictModes yes
233X11Forwarding no
234X11DisplayOffset 10
235PrintMotd yes
236KeepAlive yes
237
238# Logging
239SyslogFacility AUTH
240LogLevel INFO
241#obsoletes QuietMode and FascistLogging
242
243RhostsAuthentication no
244#
245# For this to work you will also need host keys in /etc/ssh_known_hosts
246RhostsRSAAuthentication no
247
248# To install for logon to different user accounts change to "no" here
249RSAAuthentication yes
250
251# To install for logon to different user accounts change to "yes" here
252PasswordAuthentication no
253
254PermitEmptyPasswords no
255
256CheckMail no
257UseLogin no
258
259#Uncomment if you want to enable sftp
260#Subsystem sftp /usr/sbin/sftp-server
261#MaxStartups 10:30:60
262EOF
263fi
264
265# Ask user if user identity should be generated
266
267if [ "X${HOME}" = "X" ]
268then
269 echo '$HOME is nonexistant. Cannot create user identity files.'
270 exit 1
271fi
272
273if [ ! -d "${HOME}" ]
274then
275 echo '$HOME is not a valid directory. Cannot create user identity files.'
276 exit 1
277fi
278
279# If HOME is the root dir, set HOME to empty string to avoid error messages
280# in subsequent parts of that script.
281if [ "X${HOME}" = "X/" ]
282then
283 HOME=''
284fi
285
286if [ -e "${HOME}/.ssh" -a ! -d "${HOME}/.ssh" ]
287then
288 echo '$HOME/.ssh is existant but not a directory. Cannot create user identity files.'
289 exit 1
290fi
291
292if [ ! -e "${HOME}/.ssh" ]
293then
294 mkdir "${HOME}/.ssh"
295 if [ ! -e "${HOME}/.ssh" ]
296 then
297 echo "Creating users ${HOME}/.ssh directory failed"
298 exit 1
299 fi
300fi
301
302if [ ! -f "${HOME}/.ssh/identity" ]
303then
304 if request "Shall I create an RSA identity file for you?"
305 then
306 echo "Generating ${HOME}/.ssh/identity"
307 ssh-keygen -f "${HOME}/.ssh/identity"
308 fi
309fi
310
311if [ ! -f "${HOME}/.ssh/id_dsa" ]
312then
313 if request "Shall I create an DSA identity file for you? (yes/no) "
314 then
315 echo "Generating ${HOME}/.ssh/id_dsa"
316 ssh-keygen -d -f "${HOME}/.ssh/id_dsa"
317 fi
318fi
319
320echo
321echo "Note: If you have used sshd as service or from inetd, don't forget to"
322echo " change the path to sshd.exe in the service entry or in inetd.conf."
323echo
324echo "Configuration finished. Have fun!"