Which user works with my Windows Bash operating system when it interacts with the Windows file system?

I downloaded and installed Bash for Windows. When I make it simple ls -al, I get a lot of permissions.

I do not quite understand how user rights are resolved. Let's say that in the Bash shell I configured a user with a name moiand has a home drive /home/moi. If I then perform ls -al /mnt/c, I get a bunch of permissions, for example,

ls: cannot access /mnt/c/hiberfil.sys: Permission denied 
ls: cannot access /mnt/c/pagefile.sys: Permission denied 
ls: cannot access /mnt/c/swapfile.sys: Permission denied total 2388

    drwxrwxrwx 2 root root      0 Sep 26 18:09 .
    drwxr-xr-x 2 root root      0 Jan  1  1970 ..
    drwxrwxrwx 2 root root      0 Oct 22  2015 AutoDiscover
    -r-xr-xr-x 1 root root 398156 Jul 26  2012 bootmgr
    -r-xr-xr-x 1 root root      1 Oct 30  2015 BOOTNXT

I checked the "Windows side" and there is no new user with the name moi. So, when lsit reports a denial of permission for /mnt/c/swapfile.sys, for example, what does the user refuse?

: , Bash "" Windows ?

+4
2

Windows - , bash.exe. , Linux /mnt/c, Windows.

:

C:\test>echo %USERNAME%
tim

C:\test>bash.exe
wsluser@computer:/mnt/c/test$ touch foo.txt
wsluser@computer:/mnt/c/test$ exit
exit

C:\test>dir /q C:\test\foo.txt
 Volume in drive C is OS
 Volume Serial Number is B8BA-E032

 Directory of C:\test

2017-06-26  02:06 PM                 0 tim   foo.txt
               1 File(s)              0 bytes
               0 Dir(s)  363,224,875,008 bytes free

, bash.exe tim, C:\test\foo.txt, WSL, tim.

+2

Linux, Windows. AppData\Local. "", :

C:\Users\[ ]\AppData\Local\lxss\

0

Source: https://habr.com/ru/post/1655932/


All Articles