I have Ubuntu WSL with default username wsl and new user with username newuser
List all files :
wsl@Optiplex:~$ ls -la
total 176
drwxr-xr-x 13 wsl wsl 4096 Nov 1 06:36 .
drwxr-xr-x 4 root root 4096 Oct 3 03:09 ..
drwxr-x--- 2 wsl wsl 4096 Sep 27 20:29 .android
-rw------- 1 wsl wsl 101618 Nov 1 04:38 .bash_history
-rw-r--r-- 1 wsl wsl 220 Sep 4 14:11 .bash_logout
-rw-r--r-- 1 wsl wsl 3771 Sep 4 14:11 .bashrc
drwx------ 2 wsl wsl 4096 Oct 9 21:42 .cache
drwx------ 3 wsl wsl 4096 Sep 14 01:05 .config
drwxr-xr-x 2 wsl wsl 4096 Sep 4 14:11 .landscape
drwxr-xr-x 3 wsl wsl 4096 Sep 14 02:26 .local
-rw-r--r-- 1 wsl wsl 0 Oct 9 21:31 .motd_shown
Then i add newuser to wsl group
usermod -aG wsl newuser
But still permission denied.
newuser@Optiplex:/home/wsl$ ls .cache/
ls: cannot open directory '.cache/': Permission denied
newuser@Optiplex:/home/wsl$ touch test
touch: cannot touch 'test': Permission denied
newuser@Optiplex:/home/wsl$
id wsl : uid=1000(wsl) gid=1000(wsl) groups=1000(wsl),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),117(netdev)
id newuser : uid=1001(newuser) gid=1001(newuser) groups=1001(newuser),1000(wsl)
What i must do for allow read and write in /home/wsl without chmod/chgrp/ change permission. thanks