Cygwin Tips

From EggeWiki
Revision as of 00:08, 12 September 2007 by Brianegge (talk | contribs) (New page: I kept getting this problem with Cygwin. I've never had this problem with non-domain accounts, or where my home directory is on my local hard drive: <geshi lang="bash"> @@@@@@@@@@@@@@@@@...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I kept getting this problem with Cygwin. I've never had this problem with non-domain accounts, or where my home directory is on my local hard drive:

<geshi lang="bash"> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0444 for '/cygdrive/z/.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: /cygdrive/z/.ssh/id_rsa </geshi>

I would try every combination of chmod and Windows permissions without any luck. <geshi lang="bash"> begge1@AA055369 ~ $ ll /cygdrive/z/.ssh/id_rsa -r--r--r-- 1 begge1 Domain Users 1675 Sep 12 10:07 /cygdrive/z/.ssh/id_rsa

begge1@AA055369 ~ $ chmod 400 /cygdrive/z/.ssh/id_rsa

begge1@AA055369 ~ $ ll /cygdrive/z/.ssh/id_rsa -r--r--r-- 1 begge1 Domain Users 1675 Sep 12 10:07 /cygdrive/z/.ssh/id_rsa </geshi>

Fortunately I found this solution:

Cygwin can emulate more Unix-like file permissions but it is not enabled by default. One has to add "ntea" to CYGWIN variable in the cygwin.bat file in the cygwin root directory, which tends to be C:\cygwin. For example I have:
set CYGWIN=tty ntea
in C:\cygwin\cygwin.bat
With this, "chmod 0600 .id_rsa" works as in Unix. ssh stopped complaining and I could ssh w/o entering a password. Happy ending.

Thanks to "Teruhiko Kurosaka" for this tip.

<geshi lang="bash"> begge1@AA055369 ~ $ ll .ssh/id_rsa total 34 -r--r--r-- 1 begge1 Domain Users 1675 Sep 12 10:07 id_rsa

begge1@AA055369 ~ $ chmod 400 .ssh/id_rsa

begge1@AA055369 ~ $ ll .ssh/id_rsa total 34 -r-------- 1 begge1 Domain Users 1675 Sep 12 10:07 id_rsa </geshi>