Cygwin Tips: Difference between revisions

From EggeWiki
mNo edit summary
mNo edit summary
 
Line 5: Line 5:
I was getting this error.
I was getting this error.


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


I found this [[http://www.whitesquaresoft.com/2006/07/15/cvsrootccess-on-cvs-execution/ solution]]:
I found this [[http://www.whitesquaresoft.com/2006/07/15/cvsrootccess-on-cvs-execution/ solution]]:
<geshi lang="bash">
<syntaxhighlight lang="bash">
find . -name Root -or -name Entries -or -name Repository | while read file; do dos2unix.exe "$file"; done
find . -name Root -or -name Entries -or -name Repository | while read file; do dos2unix.exe "$file"; done
</geshi>
</syntaxhighlight>


== Cygwin File Permissions ==
== Cygwin File Permissions ==
Line 20: Line 20:
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:
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">
<syntaxhighlight lang="bash">
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@        WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@        WARNING: UNPROTECTED PRIVATE KEY FILE!          @
Line 28: Line 28:
This private key will be ignored.
This private key will be ignored.
bad permissions: ignore key: /cygdrive/z/.ssh/id_rsa
bad permissions: ignore key: /cygdrive/z/.ssh/id_rsa
</geshi>
</syntaxhighlight>


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">
<syntaxhighlight lang="bash">
brian@windoze ~
brian@windoze ~
$ ll /cygdrive/z/.ssh/id_rsa
$ ll /cygdrive/z/.ssh/id_rsa
Line 42: Line 42:
$ ll /cygdrive/z/.ssh/id_rsa
$ ll /cygdrive/z/.ssh/id_rsa
-r--r--r-- 1 brian 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>
</syntaxhighlight>


Fortunately I found this solution:
Fortunately I found this solution:
Line 53: Line 53:
Thanks to "Teruhiko Kurosaka" for this tip.
Thanks to "Teruhiko Kurosaka" for this tip.


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


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

Latest revision as of 19:10, 10 December 2011

Word Splitting

Cygwin CVS

I was getting this error.

$ cvs up
/CVSROOTccess /usr/local/cvsroot
No such file or directory

I found this [solution]:

find . -name Root -or -name Entries -or -name Repository | while read file; do dos2unix.exe "$file"; done

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:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         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

I would try every combination of chmod and Windows permissions without any luck.

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

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.

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

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.