Cygwin Tips: Difference between revisions

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


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


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


Line 54: Line 54:


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


begge1@AA055369 ~
brian@windoz ~
$ chmod 400 .ssh/id_rsa
$ chmod 400 .ssh/id_rsa


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



Revision as of 01:36, 20 October 2009

Word Splitting

Cygwin CVS

I was getting this error.

<geshi lang="bash"> $ cvs up /CVSROOTccess /usr/local/cvsroot No such file or directory </geshi>

I found this [solution]: <geshi lang="bash"> find . -name Root -or -name Entries -or -name Repository | while read file; do dos2unix.exe "$file"; done </geshi>

Cygwin File Permissions

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"> brian@windoze ~ $ ll /cygdrive/z/.ssh/id_rsa -r--r--r-- 1 brian Domain Users 1675 Sep 12 10:07 /cygdrive/z/.ssh/id_rsa

brian@windoz ~ $ chmod 400 /cygdrive/z/.ssh/id_rsa

brian@windoz ~ $ ll /cygdrive/z/.ssh/id_rsa -r--r--r-- 1 brian 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.

Thanks to "Teruhiko Kurosaka" for this tip.

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

brian@windoz ~ $ chmod 400 .ssh/id_rsa

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

What matters is really what kind of file system your home directory is on. It's usually either:

  • Local disk
  • SAMBA share
  • Netapp

Local disk should work with the Cygwin defaults, but for SAMBA types, it usually requires some tweaking. If you can't get anything to work, it very might well be that your home directory is world-readable. This happened to me after the Windows server guys moved my home drive over a weekend.

My addition tip is to put CYGWIN=tty ntea in your Windows environment variables so [rxvt] works just as well. IMHO [rxvt] should be the default exe for Cygwin, as it's much friendlier than the cmd.exe which Cygwin normally runs in.