Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I create a file using Cygwin (on Windows 7), the file owner is Administrators. When I create a file with a Windows command shell (same computer, login, etc), the owner is me. How do I get Cygwin to have the owner be me, rather than Administrators?

I've read that Windows has a local security policy that governs whether newly created files are owned by the user who creates them or group Administrators (if the user is a member of group Administrators). How do I change that policy? And why is the Cygwin shell not behaving the same way as the Windows command shell in regard to this policy?

share|improve this question
The following article provides details about how Windows decides to set the file owner to Administrators: Let's say my login is chuck. If chuck is in the Administrators group, then Windows will (by default) set the file owner to Administrators. Why, then, when I create a file from the Windows shell, is it owned by chuck, rather than Administrators? I want Cygwin to behave as the Windows shell does. – cmessenger Sep 17 '13 at 23:27
I discovered that there exists a Windows command line utility - whoami.exe - which displays your security access token contents. This could help debug what's going on: run it from a Cygwin shell, then from a Windows cmd shell, and see what, if anything, is different. – cmessenger Sep 18 '13 at 0:06
I discovered a Cygwin utility - cygdrop (part of the cygutils-extra package) - whose purpose is to drop specified privileges from the access token in a spawned process. By default, it drops all Administrator privileges. Unfortunately, I found that when I run "cygdrop /cygdrive/c/Windows/System32/whoami.exe /groups", I see that the Administrators group is still in the access token. – cmessenger Sep 18 '13 at 14:38

You must log in to answer this question.

Browse other questions tagged .