On one Windows 10 PC, when I create a file from a Cygwin bash shell, the Windows security settings for the file are corrupted.

So, for example, if I type echo test > test.txt, when I bring up the “Properties” → “Security” tab in Windows, I get the following error message: "The permissions on test.txt are incorrectly ordered, which may cause some entries to be ineffective", and (among other issues) I see in the “Group or user names” list box "NULL SID". And when I click on the “Advanced” button, I see several group entries with the "Deny" type. This seems to happen no matter how I create a file. I have tried vi and bzip2 and have the same issue.

This is a local NTFS hard drive.  The folder permissions are correct and I am a local admin on the PC.

I have another Windows 10 PC with Cygwin, running the same bash script, and it works fine.

  • When you create the files from the Linux terminal you are expecting the file permissions to be set or open as what exactly from the Windows NTFS ACL permission levels? Have you played with chmod commands and test output after echo creation too? Look up on Google "gotchas with creating files using cygwin on Windows 10".... and look for something relevant, etc. – Pimp Juice IT Nov 16 '18 at 23:01

There is a long explanation of the complex mapping of Posix permissions using Windows ACE


Almost at the end in File permissions

Unfortunately the security tab in the file properties dialog of the Windows Explorer insists to rearrange the order of the ACEs to canonical order before you can read them. Thank God, the sort order remains unchanged if one presses the Cancel button. But don't even think of pressing OK...

So the behaviour it is not a mistake, it is by design and just the Windows Explorer has it is own view that does not match the rest of Windows system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.