This post was originally from here.
Windows Subsystem for Linux (WSL) usually mounts Windows drives under
However, the Linux file permission seems to be awful.
To fix this issue, simply add to
/etc/wsl.conf (if the file does not exist, simply create it):
[automount] enabled = true options = "metadata,umask=22,fmask=11"
In short, every files now have permission
0644 and every directories have permission
Also, add the following to
~/.profile to fix the permission of newly created files and directories.
if [[ "$(umask)" = "0000" ]]; then umask 0022 fi