CYGWIN File permissions problems

I’m currently using cygwin to sync files between my Linux dev environment and windows. It’s not that often because I mainly develop on a Linux desktop anyways. However, I recently ran into some problems with rsync. I kept getting file permissions errors when using rsync to sync from my windows desktop to my Linux server.

After some digging I found that when doing a “ls -l”, none of the file permissions were setup on any of the folders that were being synced. After looking on the internet, all the articles lead me to believe I needed to set my CYGWIN variable to ntsec.

So I went ahead and set my CYGWIN variable to ntsec, but the problem was still there. I had a little plus at the end of the file permissions list and none of them were set. It looked something like this.

d———+

I had almost given up when I found an old program I was using before, which is a stripped down version of cygwin and rsync with a cmd file for doing the sync. In there I discovered that they set the CYGWIN variable to nontsec!

So there it is, I set CYGWIN to nontsec and everything worked great!

For those of you who would like the steps to permanently fix this, here they are.

  1. Make sure you have vim or some other editor installed.
  2. Edit your .bash_profile in your home directory. $ vim ~/.bash_profile
  3. Add this line to the bottom of the file: export CYGWIN=”nontsec”
  4. Save the file and quit. for vim type :qw
  5. Restart cygwin

You should now see file permissions setup on all your directories and files!

I hope this helps out someone else who fould all the posts out there to be very confusing and not very informative!

2 thoughts on “CYGWIN File permissions problems”

  1. Actually, the issue stems from a incorrect value in /etc/passwd for the NT user you are using.
    Swap the :513: default group settings to :545: and voila it works.
    Ciao

Leave a Reply

Your email address will not be published. Required fields are marked *