Allow to set file permissions on NTFS partitions from WSL
Allow commands like chmod to set file permissions on NTFS partitions. Currently WSL supports a limited one way permission mapping from Windows ACL's to POSIX permissions but it needs to be 2-way. Many basic tasks like using ssh keys or working with git repos require being able to set file permissions. It doesn't even matter that much to which exactly windows ACL certain permissions map as long as they are consistent (e.g. setting perms with chmod and then getting them with stat should result in exact same perms).
This is a followup to this closed issue: https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13309479-emulate-posix-compliant-filesystem-permissions
Leonid Milenky commented
1. chmod and ability to update permissions (writable, executable) is "must have" -- just for normal
look of the files. To have .txt file executable is completely wrong.
2. It would be nice to have owner to be 'user' by default, not 'root'. Or at least make chown work.
Done in lnsider builds. See the Release notes.
Joseph Orbegoso Pea (Joe Pea) commented
It is a pain to make a folder on an NTFS partition with all 777 permissions where chmod and chown doesn't do anything.
My build tools are having weird bugs due to permissions.
At least, make chmod work from the perspective of the WSL so it *thinks* a file has permissions and ownership as defined, even if from the windows side nothing seems to have changed. It can be purely virtual and not actually for security.
Just make it work!
I loved when I had NTFS-3G and from an actual metal Linux install was able to work with NTFS drives as if they were Linux drives, with ownership and permissions modifiable with chmod and chown. It would just be GREAT to have this in WSL.
Adam Taylor commented
I would broaden this issue and say that it would be nice if WSL did a bit more to make NTFS files look more "normal" in general. One part of this would be to make chmod do something sensible on NTFS files. Another would be to map NTFS owners to something besides "root" in WSL. I understand it's a hard problem, but this really would make bash more of a replacement for Cygwin, MSYS2, Hamilton C Shell, and other unix-y command lines that were previously available in Windows. Honestly, just changing the default color scheme in bash so that the files in NTFS volumes aren't highlighted in green would be a step in the right direction. The issue https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/20119681-make-the-windows-fs-mounts-under-wsl-have-reasonab seems part-and-parcel of this larger issue.
David Beauchesne commented
When WSL was first announced, I had great hopes that I would be able to replace Cygwin and use it for git/repo and compiling/linking. Unfortunately, without basic chmod capabilities, that will not happen.
Please consider offering support for chmod in the future. Until then, WSL is of very limited value to me.