My thoughts as an enterprise Java developer.

Friday, February 23, 2007

Cygwin ssh and key files

I tried to use key files with Cygwin ssh (so I don't have to provide my password each time) but kept running into the following error:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '//turfclub/users/jstauffe/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: //turfclub/users/jstauffe/.ssh/id_rsa
The problem is that chmod wouldn't actually change the permissions so I couldn't get past this problem. When I searched on this I found refernces to turning StrictMode off but that didn't work for me can caused errors.

To fix this I did the following:
  1. Started my bash shell
  2. mkdir /home
  3. mkdir /home/.ssh
  4. cp ~/.ssh/* /home/.ssh
  5. chmod 600 /home/.ssh/*
  6. mv ~/.ssh ~/.ssh.bak
  7. cd ~
  8. ln -s /home/.ssh

It now works great (even in the normal Windows shell)!

1 comment:

Anonymous said...

Worked perfectly for me too