Using git through cygwin on windows 8

There is no Need for an empty group.

During the Installation of cygwin all files belong to no group. You can check this by doing an ls -al. You will see that no group ("none") is on the files. Just change it to Users:

chgrp Users *

After this you can chmod whatever you like.


I've found a Cygwin-specific hack to get around this for now.

Short version:
Simply create a new empty windows group, use chgrp to change the group of id_rsa to this, and then deny read/write permissions for the group.

Long version:
Press the super key and type lusrmgr.msc. Use this manager to create an empty group, called say EMPTY_GROUP

Now we need to tell Cygwin about this new group.

mkgroup > /etc/group

Next we update the group of id_rsa:

chgrp EMPTY_GROUP ~/.ssh/id_rsa

Finally, go find id_rsa in Windows Explorer, and under the Security tab in Properties, deny read/write permissions, and you should be good to go.

I'm not sure how Cygwin was able to handle this in 7 but not 8, but the problem seems to stems from the group of the id_rsa file being None, a group that always has full read/write access.

Also, this seems to only work for the ssh.exe that comes with Cygwin, so if you want to use say ssh with git, overwrite the ssh.exe from bin in your git install with the one from the bin folder in your Cywgin install.


Win 8 + Cygwin

I am on Windows 8, 64bit. Doing the following solves it for me:

## Start Cygwin shell
cd .ssh
chmod 600 key-file-name