Permission denied for ls /usr/bin on windows subsystem for linux
ls /usr/bin
gives the error message:
ls: reading directory '/usr/bin': Permission denied
on wbash.exe
. For that reason bash-completion and eshell-completion fails or gives incomplete results. I would like to get it working.
Things that do work:
/usr/bin $ ls -l emacs
lrwxrwxrwx 1 root root 23 2017-07-31 17:16 emacs -> /etc/alternatives/emacs
/usr/bin $ ls -l gcc-5
-rwxr-xr-x 1 root root 915736 2017-09-14 06:01 gcc-5
/usr/bin $ ls -ld /usr/bin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/bin
/usr/bin $ ls -ld /usr/sbin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/sbin
/usr/bin $ ls -ld /
drwxr-xr-x 0 root root 512 2017-11-17 10:23 /
/usr/bin $ ls -ld /usr
drwxr-xr-x 0 root root 512 2017-03-30 11:55 /usr
Windows version is: Windows 10 (64bit), Version 1703 (Build 15063.786)
The sbin
directory can be listed without problems and all windows settings of bin
in %USERPROFILE%AppDataLocallxssrootfsusr
available via WindowsExplorer are the same as that ones for sbin
.
The commands icacls.exe bin
and icacls.exe sbin
within %USERPROFILE%AppDataLocallxssrootfsusr
give exactly the same answer (up to the first word which is bin
for bin
and sbin
for sbin
). So it does not seem to be related to the extra attributes. Also the commands icacls.exe bin /verify
and icacls.exe sbin /verify
don't indicate any errors.
Is there maybe some security-related feature of ubuntu (I don't know of) that prohibits me to list the directory contents of /usr/bin
? (In that case it would be strange if it didn't forbid the listing of /usr/sbin
.)
ubuntu windows-subsystem-for-linux windows-10-v1703
|
show 6 more comments
ls /usr/bin
gives the error message:
ls: reading directory '/usr/bin': Permission denied
on wbash.exe
. For that reason bash-completion and eshell-completion fails or gives incomplete results. I would like to get it working.
Things that do work:
/usr/bin $ ls -l emacs
lrwxrwxrwx 1 root root 23 2017-07-31 17:16 emacs -> /etc/alternatives/emacs
/usr/bin $ ls -l gcc-5
-rwxr-xr-x 1 root root 915736 2017-09-14 06:01 gcc-5
/usr/bin $ ls -ld /usr/bin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/bin
/usr/bin $ ls -ld /usr/sbin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/sbin
/usr/bin $ ls -ld /
drwxr-xr-x 0 root root 512 2017-11-17 10:23 /
/usr/bin $ ls -ld /usr
drwxr-xr-x 0 root root 512 2017-03-30 11:55 /usr
Windows version is: Windows 10 (64bit), Version 1703 (Build 15063.786)
The sbin
directory can be listed without problems and all windows settings of bin
in %USERPROFILE%AppDataLocallxssrootfsusr
available via WindowsExplorer are the same as that ones for sbin
.
The commands icacls.exe bin
and icacls.exe sbin
within %USERPROFILE%AppDataLocallxssrootfsusr
give exactly the same answer (up to the first word which is bin
for bin
and sbin
for sbin
). So it does not seem to be related to the extra attributes. Also the commands icacls.exe bin /verify
and icacls.exe sbin /verify
don't indicate any errors.
Is there maybe some security-related feature of ubuntu (I don't know of) that prohibits me to list the directory contents of /usr/bin
? (In that case it would be strange if it didn't forbid the listing of /usr/sbin
.)
ubuntu windows-subsystem-for-linux windows-10-v1703
what it the output ofls -ld /
andls -ld /usr
?
– Giacomo Catenazzi
Dec 21 '17 at 9:33
@GiacomoCatenazzi I added those two to the list. Nothing surprising there.
– Tobias
Dec 21 '17 at 9:36
So it seems to be because of extra attributes, look e.g. technet.microsoft.com/en-us/library/cc753525(v=ws.11).aspx
– Giacomo Catenazzi
Dec 21 '17 at 9:43
@GiacomoCatenazzi The commandsicacls.exe bin
andicacls.exe sbin
give exactly the same answer (up to the first word which isbin
forbin
andsbin
forsbin
). So it does not seem to be related to the extra attributes. Is that right? Or are there some nifty tricks to get even more information?icacls.exe bin /verify
andicacls.exe sbin /verify
doesn't output any errors.
– Tobias
Dec 21 '17 at 9:52
@GiacomoCatenazzi I can list the contents ofbin
(andsbin
) without problems under windows (e.g., WindowsExplorer or PowerShelldir bin
orls bin
)
– Tobias
Dec 21 '17 at 9:55
|
show 6 more comments
ls /usr/bin
gives the error message:
ls: reading directory '/usr/bin': Permission denied
on wbash.exe
. For that reason bash-completion and eshell-completion fails or gives incomplete results. I would like to get it working.
Things that do work:
/usr/bin $ ls -l emacs
lrwxrwxrwx 1 root root 23 2017-07-31 17:16 emacs -> /etc/alternatives/emacs
/usr/bin $ ls -l gcc-5
-rwxr-xr-x 1 root root 915736 2017-09-14 06:01 gcc-5
/usr/bin $ ls -ld /usr/bin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/bin
/usr/bin $ ls -ld /usr/sbin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/sbin
/usr/bin $ ls -ld /
drwxr-xr-x 0 root root 512 2017-11-17 10:23 /
/usr/bin $ ls -ld /usr
drwxr-xr-x 0 root root 512 2017-03-30 11:55 /usr
Windows version is: Windows 10 (64bit), Version 1703 (Build 15063.786)
The sbin
directory can be listed without problems and all windows settings of bin
in %USERPROFILE%AppDataLocallxssrootfsusr
available via WindowsExplorer are the same as that ones for sbin
.
The commands icacls.exe bin
and icacls.exe sbin
within %USERPROFILE%AppDataLocallxssrootfsusr
give exactly the same answer (up to the first word which is bin
for bin
and sbin
for sbin
). So it does not seem to be related to the extra attributes. Also the commands icacls.exe bin /verify
and icacls.exe sbin /verify
don't indicate any errors.
Is there maybe some security-related feature of ubuntu (I don't know of) that prohibits me to list the directory contents of /usr/bin
? (In that case it would be strange if it didn't forbid the listing of /usr/sbin
.)
ubuntu windows-subsystem-for-linux windows-10-v1703
ls /usr/bin
gives the error message:
ls: reading directory '/usr/bin': Permission denied
on wbash.exe
. For that reason bash-completion and eshell-completion fails or gives incomplete results. I would like to get it working.
Things that do work:
/usr/bin $ ls -l emacs
lrwxrwxrwx 1 root root 23 2017-07-31 17:16 emacs -> /etc/alternatives/emacs
/usr/bin $ ls -l gcc-5
-rwxr-xr-x 1 root root 915736 2017-09-14 06:01 gcc-5
/usr/bin $ ls -ld /usr/bin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/bin
/usr/bin $ ls -ld /usr/sbin
drwxr-xr-x 0 root root 512 2017-12-19 09:45 /usr/sbin
/usr/bin $ ls -ld /
drwxr-xr-x 0 root root 512 2017-11-17 10:23 /
/usr/bin $ ls -ld /usr
drwxr-xr-x 0 root root 512 2017-03-30 11:55 /usr
Windows version is: Windows 10 (64bit), Version 1703 (Build 15063.786)
The sbin
directory can be listed without problems and all windows settings of bin
in %USERPROFILE%AppDataLocallxssrootfsusr
available via WindowsExplorer are the same as that ones for sbin
.
The commands icacls.exe bin
and icacls.exe sbin
within %USERPROFILE%AppDataLocallxssrootfsusr
give exactly the same answer (up to the first word which is bin
for bin
and sbin
for sbin
). So it does not seem to be related to the extra attributes. Also the commands icacls.exe bin /verify
and icacls.exe sbin /verify
don't indicate any errors.
Is there maybe some security-related feature of ubuntu (I don't know of) that prohibits me to list the directory contents of /usr/bin
? (In that case it would be strange if it didn't forbid the listing of /usr/sbin
.)
ubuntu windows-subsystem-for-linux windows-10-v1703
ubuntu windows-subsystem-for-linux windows-10-v1703
edited Dec 21 '17 at 10:55
Tobias
asked Dec 21 '17 at 9:09
TobiasTobias
12116
12116
what it the output ofls -ld /
andls -ld /usr
?
– Giacomo Catenazzi
Dec 21 '17 at 9:33
@GiacomoCatenazzi I added those two to the list. Nothing surprising there.
– Tobias
Dec 21 '17 at 9:36
So it seems to be because of extra attributes, look e.g. technet.microsoft.com/en-us/library/cc753525(v=ws.11).aspx
– Giacomo Catenazzi
Dec 21 '17 at 9:43
@GiacomoCatenazzi The commandsicacls.exe bin
andicacls.exe sbin
give exactly the same answer (up to the first word which isbin
forbin
andsbin
forsbin
). So it does not seem to be related to the extra attributes. Is that right? Or are there some nifty tricks to get even more information?icacls.exe bin /verify
andicacls.exe sbin /verify
doesn't output any errors.
– Tobias
Dec 21 '17 at 9:52
@GiacomoCatenazzi I can list the contents ofbin
(andsbin
) without problems under windows (e.g., WindowsExplorer or PowerShelldir bin
orls bin
)
– Tobias
Dec 21 '17 at 9:55
|
show 6 more comments
what it the output ofls -ld /
andls -ld /usr
?
– Giacomo Catenazzi
Dec 21 '17 at 9:33
@GiacomoCatenazzi I added those two to the list. Nothing surprising there.
– Tobias
Dec 21 '17 at 9:36
So it seems to be because of extra attributes, look e.g. technet.microsoft.com/en-us/library/cc753525(v=ws.11).aspx
– Giacomo Catenazzi
Dec 21 '17 at 9:43
@GiacomoCatenazzi The commandsicacls.exe bin
andicacls.exe sbin
give exactly the same answer (up to the first word which isbin
forbin
andsbin
forsbin
). So it does not seem to be related to the extra attributes. Is that right? Or are there some nifty tricks to get even more information?icacls.exe bin /verify
andicacls.exe sbin /verify
doesn't output any errors.
– Tobias
Dec 21 '17 at 9:52
@GiacomoCatenazzi I can list the contents ofbin
(andsbin
) without problems under windows (e.g., WindowsExplorer or PowerShelldir bin
orls bin
)
– Tobias
Dec 21 '17 at 9:55
what it the output of
ls -ld /
and ls -ld /usr
?– Giacomo Catenazzi
Dec 21 '17 at 9:33
what it the output of
ls -ld /
and ls -ld /usr
?– Giacomo Catenazzi
Dec 21 '17 at 9:33
@GiacomoCatenazzi I added those two to the list. Nothing surprising there.
– Tobias
Dec 21 '17 at 9:36
@GiacomoCatenazzi I added those two to the list. Nothing surprising there.
– Tobias
Dec 21 '17 at 9:36
So it seems to be because of extra attributes, look e.g. technet.microsoft.com/en-us/library/cc753525(v=ws.11).aspx
– Giacomo Catenazzi
Dec 21 '17 at 9:43
So it seems to be because of extra attributes, look e.g. technet.microsoft.com/en-us/library/cc753525(v=ws.11).aspx
– Giacomo Catenazzi
Dec 21 '17 at 9:43
@GiacomoCatenazzi The commands
icacls.exe bin
and icacls.exe sbin
give exactly the same answer (up to the first word which is bin
for bin
and sbin
for sbin
). So it does not seem to be related to the extra attributes. Is that right? Or are there some nifty tricks to get even more information? icacls.exe bin /verify
and icacls.exe sbin /verify
doesn't output any errors.– Tobias
Dec 21 '17 at 9:52
@GiacomoCatenazzi The commands
icacls.exe bin
and icacls.exe sbin
give exactly the same answer (up to the first word which is bin
for bin
and sbin
for sbin
). So it does not seem to be related to the extra attributes. Is that right? Or are there some nifty tricks to get even more information? icacls.exe bin /verify
and icacls.exe sbin /verify
doesn't output any errors.– Tobias
Dec 21 '17 at 9:52
@GiacomoCatenazzi I can list the contents of
bin
(and sbin
) without problems under windows (e.g., WindowsExplorer or PowerShell dir bin
or ls bin
)– Tobias
Dec 21 '17 at 9:55
@GiacomoCatenazzi I can list the contents of
bin
(and sbin
) without problems under windows (e.g., WindowsExplorer or PowerShell dir bin
or ls bin
)– Tobias
Dec 21 '17 at 9:55
|
show 6 more comments
2 Answers
2
active
oldest
votes
It looks very much like a permissions problem.
As you have verified that the problem is not with Windows,
then this problem is with WSL internal settings,
where it emulates Linux permissions which do not natively exist on Windows.
I don't know exactly how WSL does its emulation of Linux permissions.
If it uses the Windows mechanism of ACL, you could reset them all by :
icacls %localappdata%lxss /reset /T /C
If this does not help,
and without better knowledge of how these permissions are implemented,
I would suggest to reinstall WSL :
Backup your data
Uninstall the Ubuntu environment but keep your home folder, then
reinstall WSL, by using the commands :
lxrun /uninstall
lxrun /install
If this did not help, fully reinstall the Ubuntu environment
including removing your home folder, by entering :
lxrun /uninstall /full
lxrun /install
In-between the two above commands, check that the folder
%localappdata%lxss
is empty.
If not, move its contents to temporary storage and delete later
when no longer required.
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
add a comment |
There are no permission problems with cygwin under $HOME/AppData/Local/lxss/rootfs/usr/bin
and I did some tests with playground folders of wsl under cygwin. That lead me to the following solution.
In the bash of cygwin I went to $HOME/AppData/Local/lxss/rootfs/usr
and run the following command:
find bin -mindepth 1 -maxdepth 1 -printf "cp -a %p fix/%pn" > /temp/fix.sh
That created a script /temp/fix.sh
in a folder /temp
that is shared between cygwin and wsl via symbolic links.
In wbash
I went to /usr/
, created the folders fix
and fix/bin
, run the script, and moved the directory fix/bin
to bin-fix
.
cd /usr
mkdir -p fix/bin
. /temp/fix.sh
mv fix/bin bin-fix
Thereby, wbash
told me that it had permission problems for bin/head
.
Okay, I accepted that and re-installed coreutils
as a last step of this procedure (see below).
Next I closed all wbash
applications and wbash
itself and went back to cygwin where the usr
folder was still open.
There I moved bin
out of the way and re-named bin-fix
to bin
.
mv bin bin.old
mv bin-fix bin
I re-started wbash
and voilá everything runs fine and ls /usr/bin
works.
As I already mentioned above I re-installed coreutils
as a last step:
sudo aptitude reinstall coreutils
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1279034%2fpermission-denied-for-ls-usr-bin-on-windows-subsystem-for-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It looks very much like a permissions problem.
As you have verified that the problem is not with Windows,
then this problem is with WSL internal settings,
where it emulates Linux permissions which do not natively exist on Windows.
I don't know exactly how WSL does its emulation of Linux permissions.
If it uses the Windows mechanism of ACL, you could reset them all by :
icacls %localappdata%lxss /reset /T /C
If this does not help,
and without better knowledge of how these permissions are implemented,
I would suggest to reinstall WSL :
Backup your data
Uninstall the Ubuntu environment but keep your home folder, then
reinstall WSL, by using the commands :
lxrun /uninstall
lxrun /install
If this did not help, fully reinstall the Ubuntu environment
including removing your home folder, by entering :
lxrun /uninstall /full
lxrun /install
In-between the two above commands, check that the folder
%localappdata%lxss
is empty.
If not, move its contents to temporary storage and delete later
when no longer required.
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
add a comment |
It looks very much like a permissions problem.
As you have verified that the problem is not with Windows,
then this problem is with WSL internal settings,
where it emulates Linux permissions which do not natively exist on Windows.
I don't know exactly how WSL does its emulation of Linux permissions.
If it uses the Windows mechanism of ACL, you could reset them all by :
icacls %localappdata%lxss /reset /T /C
If this does not help,
and without better knowledge of how these permissions are implemented,
I would suggest to reinstall WSL :
Backup your data
Uninstall the Ubuntu environment but keep your home folder, then
reinstall WSL, by using the commands :
lxrun /uninstall
lxrun /install
If this did not help, fully reinstall the Ubuntu environment
including removing your home folder, by entering :
lxrun /uninstall /full
lxrun /install
In-between the two above commands, check that the folder
%localappdata%lxss
is empty.
If not, move its contents to temporary storage and delete later
when no longer required.
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
add a comment |
It looks very much like a permissions problem.
As you have verified that the problem is not with Windows,
then this problem is with WSL internal settings,
where it emulates Linux permissions which do not natively exist on Windows.
I don't know exactly how WSL does its emulation of Linux permissions.
If it uses the Windows mechanism of ACL, you could reset them all by :
icacls %localappdata%lxss /reset /T /C
If this does not help,
and without better knowledge of how these permissions are implemented,
I would suggest to reinstall WSL :
Backup your data
Uninstall the Ubuntu environment but keep your home folder, then
reinstall WSL, by using the commands :
lxrun /uninstall
lxrun /install
If this did not help, fully reinstall the Ubuntu environment
including removing your home folder, by entering :
lxrun /uninstall /full
lxrun /install
In-between the two above commands, check that the folder
%localappdata%lxss
is empty.
If not, move its contents to temporary storage and delete later
when no longer required.
It looks very much like a permissions problem.
As you have verified that the problem is not with Windows,
then this problem is with WSL internal settings,
where it emulates Linux permissions which do not natively exist on Windows.
I don't know exactly how WSL does its emulation of Linux permissions.
If it uses the Windows mechanism of ACL, you could reset them all by :
icacls %localappdata%lxss /reset /T /C
If this does not help,
and without better knowledge of how these permissions are implemented,
I would suggest to reinstall WSL :
Backup your data
Uninstall the Ubuntu environment but keep your home folder, then
reinstall WSL, by using the commands :
lxrun /uninstall
lxrun /install
If this did not help, fully reinstall the Ubuntu environment
including removing your home folder, by entering :
lxrun /uninstall /full
lxrun /install
In-between the two above commands, check that the folder
%localappdata%lxss
is empty.
If not, move its contents to temporary storage and delete later
when no longer required.
answered Dec 22 '17 at 10:25
harrymcharrymc
259k14271573
259k14271573
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
add a comment |
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
Lxrun is deprecated now.
– Biswapriyo
Dec 23 '17 at 5:17
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
@Biswa: This is for the upcoming Windows build 16215. lxrun is the current method, and most likely will continue to be available for some time.
– harrymc
Dec 23 '17 at 7:10
add a comment |
There are no permission problems with cygwin under $HOME/AppData/Local/lxss/rootfs/usr/bin
and I did some tests with playground folders of wsl under cygwin. That lead me to the following solution.
In the bash of cygwin I went to $HOME/AppData/Local/lxss/rootfs/usr
and run the following command:
find bin -mindepth 1 -maxdepth 1 -printf "cp -a %p fix/%pn" > /temp/fix.sh
That created a script /temp/fix.sh
in a folder /temp
that is shared between cygwin and wsl via symbolic links.
In wbash
I went to /usr/
, created the folders fix
and fix/bin
, run the script, and moved the directory fix/bin
to bin-fix
.
cd /usr
mkdir -p fix/bin
. /temp/fix.sh
mv fix/bin bin-fix
Thereby, wbash
told me that it had permission problems for bin/head
.
Okay, I accepted that and re-installed coreutils
as a last step of this procedure (see below).
Next I closed all wbash
applications and wbash
itself and went back to cygwin where the usr
folder was still open.
There I moved bin
out of the way and re-named bin-fix
to bin
.
mv bin bin.old
mv bin-fix bin
I re-started wbash
and voilá everything runs fine and ls /usr/bin
works.
As I already mentioned above I re-installed coreutils
as a last step:
sudo aptitude reinstall coreutils
add a comment |
There are no permission problems with cygwin under $HOME/AppData/Local/lxss/rootfs/usr/bin
and I did some tests with playground folders of wsl under cygwin. That lead me to the following solution.
In the bash of cygwin I went to $HOME/AppData/Local/lxss/rootfs/usr
and run the following command:
find bin -mindepth 1 -maxdepth 1 -printf "cp -a %p fix/%pn" > /temp/fix.sh
That created a script /temp/fix.sh
in a folder /temp
that is shared between cygwin and wsl via symbolic links.
In wbash
I went to /usr/
, created the folders fix
and fix/bin
, run the script, and moved the directory fix/bin
to bin-fix
.
cd /usr
mkdir -p fix/bin
. /temp/fix.sh
mv fix/bin bin-fix
Thereby, wbash
told me that it had permission problems for bin/head
.
Okay, I accepted that and re-installed coreutils
as a last step of this procedure (see below).
Next I closed all wbash
applications and wbash
itself and went back to cygwin where the usr
folder was still open.
There I moved bin
out of the way and re-named bin-fix
to bin
.
mv bin bin.old
mv bin-fix bin
I re-started wbash
and voilá everything runs fine and ls /usr/bin
works.
As I already mentioned above I re-installed coreutils
as a last step:
sudo aptitude reinstall coreutils
add a comment |
There are no permission problems with cygwin under $HOME/AppData/Local/lxss/rootfs/usr/bin
and I did some tests with playground folders of wsl under cygwin. That lead me to the following solution.
In the bash of cygwin I went to $HOME/AppData/Local/lxss/rootfs/usr
and run the following command:
find bin -mindepth 1 -maxdepth 1 -printf "cp -a %p fix/%pn" > /temp/fix.sh
That created a script /temp/fix.sh
in a folder /temp
that is shared between cygwin and wsl via symbolic links.
In wbash
I went to /usr/
, created the folders fix
and fix/bin
, run the script, and moved the directory fix/bin
to bin-fix
.
cd /usr
mkdir -p fix/bin
. /temp/fix.sh
mv fix/bin bin-fix
Thereby, wbash
told me that it had permission problems for bin/head
.
Okay, I accepted that and re-installed coreutils
as a last step of this procedure (see below).
Next I closed all wbash
applications and wbash
itself and went back to cygwin where the usr
folder was still open.
There I moved bin
out of the way and re-named bin-fix
to bin
.
mv bin bin.old
mv bin-fix bin
I re-started wbash
and voilá everything runs fine and ls /usr/bin
works.
As I already mentioned above I re-installed coreutils
as a last step:
sudo aptitude reinstall coreutils
There are no permission problems with cygwin under $HOME/AppData/Local/lxss/rootfs/usr/bin
and I did some tests with playground folders of wsl under cygwin. That lead me to the following solution.
In the bash of cygwin I went to $HOME/AppData/Local/lxss/rootfs/usr
and run the following command:
find bin -mindepth 1 -maxdepth 1 -printf "cp -a %p fix/%pn" > /temp/fix.sh
That created a script /temp/fix.sh
in a folder /temp
that is shared between cygwin and wsl via symbolic links.
In wbash
I went to /usr/
, created the folders fix
and fix/bin
, run the script, and moved the directory fix/bin
to bin-fix
.
cd /usr
mkdir -p fix/bin
. /temp/fix.sh
mv fix/bin bin-fix
Thereby, wbash
told me that it had permission problems for bin/head
.
Okay, I accepted that and re-installed coreutils
as a last step of this procedure (see below).
Next I closed all wbash
applications and wbash
itself and went back to cygwin where the usr
folder was still open.
There I moved bin
out of the way and re-named bin-fix
to bin
.
mv bin bin.old
mv bin-fix bin
I re-started wbash
and voilá everything runs fine and ls /usr/bin
works.
As I already mentioned above I re-installed coreutils
as a last step:
sudo aptitude reinstall coreutils
answered Dec 22 '17 at 13:02
TobiasTobias
12116
12116
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1279034%2fpermission-denied-for-ls-usr-bin-on-windows-subsystem-for-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what it the output of
ls -ld /
andls -ld /usr
?– Giacomo Catenazzi
Dec 21 '17 at 9:33
@GiacomoCatenazzi I added those two to the list. Nothing surprising there.
– Tobias
Dec 21 '17 at 9:36
So it seems to be because of extra attributes, look e.g. technet.microsoft.com/en-us/library/cc753525(v=ws.11).aspx
– Giacomo Catenazzi
Dec 21 '17 at 9:43
@GiacomoCatenazzi The commands
icacls.exe bin
andicacls.exe sbin
give exactly the same answer (up to the first word which isbin
forbin
andsbin
forsbin
). So it does not seem to be related to the extra attributes. Is that right? Or are there some nifty tricks to get even more information?icacls.exe bin /verify
andicacls.exe sbin /verify
doesn't output any errors.– Tobias
Dec 21 '17 at 9:52
@GiacomoCatenazzi I can list the contents of
bin
(andsbin
) without problems under windows (e.g., WindowsExplorer or PowerShelldir bin
orls bin
)– Tobias
Dec 21 '17 at 9:55