WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Home directory is not working (chmod mainly)

Open aebian opened this issue 8 years ago • 8 comments

Hi WSL Team,

I have a strange issue that I wasn't able to fix by searching on google.

I have my home folder /home/aebian with a bunch of files in it. However when doing a chmod on files I get denied.

The folder is owned by myself and was copied from a Unbuntu system to /mnt/p/_temp/@BKP/aebian

Then I installed the Debian WSL and did a cp -R .* /home/aebian

The files are getting used since zsh can read the .zshrc file which also includes oh-my-zsh: image However I'm unable to perform chmod's using my normal aebian account. I need to use sudo or root instead...

Do you have any idea?

OS: Windows 10 Pro x64 Microsoft Windows [Version 10.0.16299.371] Locale: en_CA Time Zone: Atlantic TIme (Canada) → uname -a Linux itsAebian 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 GNU/Linux

==

What I tried:

  • Change permissions and owner via chmod
  • Go as root via sudo -i and perform same steps.
  • re-copy of the files from /mnt/p/_temp/@BKP/aebian

aebian avatar Apr 25 '18 21:04 aebian

What command did you type? What the error did you see? Porovde details about that error.

Biswa96 avatar Apr 25 '18 21:04 Biswa96

Funny, I told that above:

→ chmod -R 600 .ssh chmod: cannot access '.ssh/authorized_keys': Permission denied chmod: cannot access '.ssh/config': Permission denied chmod: cannot access '.ssh/freenode.pem': Permission denied chmod: cannot access '.ssh/id_rsa': Permission denied chmod: cannot access '.ssh/known_hosts': Permission denied chmod: cannot access '.ssh/known_hosts.old': Permission denied

aebian avatar Apr 25 '18 21:04 aebian

use sudo chmod -R 600 .ssh as the .ssh folder does not seem to belong to your current user. check with ls -al. chmod only changes permissions, not the owner. use sudo chown blah:blah -R .ssh to change the owner and group.

heldchen avatar Apr 26 '18 10:04 heldchen

I know how linux works and also via sudo and even as root changed the owner to aebian many times via chmod -R aebian:aebian /home/aebian/ The complete folder is owned by me. atleast my shell is telling that. The issue here is that the actual owner seems to be someone else but my user aebian is still displayed when using ls -la and I'm not quire sure if there is another way to force owner of a complete folder.

The screenshot above in the issue even refers to ~ which is /home/aebian/ and there is clearly visible that the folders are owned by me. I forgot to do a ls -la and post that output instead but the hidden folders are also owned by me.

When I'm back from work I will try to do the steps again...

Thanks for your help so far.

aebian avatar Apr 26 '18 11:04 aebian

the screenshot does not show .ssh, which is the subfolder you seem to have trouble with... depending how you chown'ed the folders this might be due to the dotfile-handling. chown * does normally not include dotted files/folders

heldchen avatar Apr 26 '18 12:04 heldchen

image

Any ideas?

aebian avatar Apr 26 '18 17:04 aebian

Issue seems to be fixed itself randomly after the restart ....

aebian avatar Apr 26 '18 18:04 aebian

any ideas what fixed it? Tried restarting, getting the same error

tylergoodman avatar Jul 03 '21 07:07 tylergoodman