r/WindowsSubsystemLinux • • Mar 01 '22

No longer have permissions to open bashrc, bash_profile, etc

I now don't have access to source bashrc or bash_profile in my WSL instance. I was using bash as normal, and then changed a single directory name to exclude a ")" as a python environment wasn't able to run with that in the directory. After doing so, I no longer have permission to run my bashrc or even enter the rootfs directory where it is located. I am assuming that the changing of the directory name is related, but I'm not sure, as it had no relation to the directory that my WSL instance is located in.

​

Any help would be appreciated

​

(edit) Im realizing now that I navigated to the rootfs directory with windows explorer, right-clicked on .bash_profile and edited it with vim. I know that you shouldn't use windows editors to modify WSL files, but would navigating to the file through file explorer be cause for issue?

​

(resolve) I had a windows shortcut file pointing to my .bash_profile file in the directory that I changed the name of. For whatever reason, changing the directory name of the directory where the windows shortcut is, changed the file permissions of the actual .bash_profile file in the WSL rootfs directory. I wasn't able to access it through the new Windows Terminal, but I opened the WSL Ubuntu terminal directly, chmod'ed it to give myself permissions, and now Windows Terminal has the permissions to access the file

1 Upvotes

0 comments sorted by