Question

When I install Cygwin, the default location is c:\cygwin and after I open a Cygwin terminal, it creates my home folder in C:\cygwin\home\ which the Everyone group has read access to by default. So, if I create a diary in vim and save it to my profile, all users of the computer I'm logged on to can read my diary. Obviously this is not the default option for normal Windows profiles, so I'm wondering what the logic is behind Cygwin's default home directory permissions, so I can use it the way it is meant to be used. Thanks!enter image description here

Was it helpful?

Solution 2

For people interested in this topic, it probably goes back to a setting called UMASK on linux, which specifies default permissions for new files. The default value of "022" means "take away no permissions from the owner, and take away write permissions from the group and the rest of the world" which means that file owners have full access, everyone else has read access.

They say it's to make it easier to share files with other users. I say it's obvious that this logic predates times when we had web browsers and other tools capable of saving passwords to disk.

OTHER TIPS

There are differences between the permission structures of windows and cygwin.

You can protect your diary by specifying its permission in windows using right click.

You can then check its permissions in cygwin using:

ls -l diary.txt

chmod 0600 diary.txt

ls -l diary.txt

Then login the same machine as a different (test) user and see if you read the file under windows, and in cygwin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top