0

I wanted to add a path to my .bashrc file on Ubuntu on Windows. Since then, I get always:

/home/gian1312/.bashrc: Permission denied 

I deleted all my changes. It did not help. Then I opened the .profile file to add the path there. --> Now I get:

/home/gian1312/.profile permission denied 

I deleted all my changes. All edits were made by Notepad++ in Windows. I am looking for a solution for several days. Probably a reinstallation would help but as long as I do not know the reason I do not want to risk to face the same problem.

Best Regards and thanks a lot
Gian

2
  • 1
    does the file have read permissions? chmod a+r .bashrc .profile to make sure... Commented Mar 9, 2018 at 21:18
  • The a+r was probably the solution. I used u +k. Thanks a lot!! Commented Mar 9, 2018 at 22:44

1 Answer 1

9

The error simply says that permission denied. Since the question is not completely clear, the following things can be tried:

1) Check the permission of the file ".bashrc" and ".profile" and make sure it is 0644

2) Check the upper level directory permission (here the folder /home/gian1312) and make sure it is 0755.

3) If the first two are fine, then you need to check the permission of the "path" which you are trying to add and it should have enough permissions to be readable by the user "gian1312"

Editing the answer as per the below comment: To change the permissions, please run the below commands:

chmod 0755 /home/gian1312 chmod 0644 /home/gian1312/.bashrc chmod 0644 /home/gian1312/.profile 
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your fast answer. Where do I check this and how can I change this values?
Hi, I have updated my answer with the command to change the permissions. Please give it a try and see if the issue gets resolved.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.