Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL 2 umask for /home folder accessed from Windows #4188

Closed
leninalive opened this issue Jun 18, 2019 · 6 comments
Closed

WSL 2 umask for /home folder accessed from Windows #4188

leninalive opened this issue Jun 18, 2019 · 6 comments

Comments

@leninalive
Copy link

When creating folders or files on WSL2's Linux partition (/home etc.) from Windows Explorer folders are always created with 777 permissions, and files with 666 - looks like umask 0 in effect. I can't find way to change system-wide umask for folders accessed from Windows - are there one?

@therealkenc
Copy link
Collaborator

therealkenc commented Jun 18, 2019

are there one?

No I don't think so. Not yet anyway. A wsl.conf addition with [9p] section with a umask parameter is a reasonable ask. [If one assumes the WSL default user is the only WSL user per the current model.]

Possible work-around, while the MSFT's house brand 9p client and server death marches to feature parity with Samba, is to run Samba (set the create umask in smb.conf). Samba works as advertised in WSL2 (ref old friend #764).

The other way to go is follow the guidance given in the WSL2 launch blog post and do all ext4 (aka /home) filesystem operations from inside WSL. This is how VS Code Remote works. However you'll have to use the "Remote - SSH" variety (contrast "Remote - WSL" variety) so sshd inside WSL can set the umask correctly.

@benhillis
Copy link
Member

@therealkenc - Agreed, some wsl.conf settings for the 9p server likely make sense. @SvenGroot - is this something you'd be open to us adding?

@therealkenc
Copy link
Collaborator

Unilateral default of 0022 would make around 93.7% of users happy, overridable in wsl.conf so much the better. Ditto tangential #352.

@benhillis
Copy link
Member

I've changed the default umask of the 9p server to 022, with an override available in /etc/wsl.conf:

[filesystem]
umask = 022

Fix will be in an upcoming Insider build.

@xbb
Copy link

xbb commented Aug 16, 2019

I've changed the default umask of the 9p server to 022, with an override available in /etc/wsl.conf:

Doesn't seem to work with build 18362.295
Is the [filesystem] section available only in Insider builds?

@xeres
Copy link

xeres commented Sep 3, 2019

Is Remote SSH the only workaround in WSL 1 + Remote WSL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants