Configuring SSH On Windows
ssh comes with both Cygwin and MSYS.
(Cygwin note: you need to ask for package
openssh (not ssh)
in the Cygwin list of packages; or use the
package -- see Installing and configuring Cygwin.)
There are several strange things about
ssh on Windows that you need to know.
cvs, seem to lock up
bashentirely if they try to get user input (e.g. if they ask for a password). To solve this, start up
cmd.exeand run it as follows:
c:\tmp> set CYGWIN32=tty c:\tmp> c:/user/local/bin/ssh-keygen1
(Cygwin-only problem, I think.)
sshneeds to access your directory
.ssh, in your home directory.
To determine your home directory
sshfirst looks in
c:/cygwin/etc/passwd(or wherever you have Cygwin installed). If there's an entry there with your userid, it'll use that entry to determine your home directory, ignoring the setting of the environment variable $HOME. If the home directory is bogus,
sshfails horribly. The best way to see what is going on is to say
ssh -v cvs.haskell.org
sshprint out information about its activity.
You can fix this problem, either by correcting the home-directory field in
c:/cygwin/etc/passwd, or by simply deleting the entire entry for your userid. If you do that,
sshuses the $HOME environment variable instead.
To protect your
.sshfrom access by anyone else, right-click your
.sshdirectory, and select
Properties. If you are not on the access control list, add yourself, and give yourself full permissions (the second panel). Remove everyone else from the access control list. Don't leave them there but deny them access, because 'they' may be a list that includes you!
ssh3.6.1 now seems to require you to have Unix permissions 600 (read/write for owner only) on the
.ssh/identityfile, else it bombs out. For your local C drive, it seems that
chmod 600 identityworks, but on Windows NT/XP, it doesn't work on a network drive (exact dteails obscure).
The solution seems to be to set the
$CYGWINenvironment variable to "
ntsec neta". The
$CYGWINenvironment variable is discussed in the Cygwin User's Guide, and there are more details in the Cygwin FAQ.