Software⏱️ 3 min read📅 2026-06-11

How to Fix: Bash on Ubuntu on Windows gives error "-bash: /home/user/.bashrc: Permission denied" on startup

Error fixing Bash on Ubuntu on Windows permission denied issue.

Quick Answer: Revert changes to .bashrc file and try running Ubuntu again.

The error '-bash: /home/user/.bashrc: Permission denied' occurs when the Bash shell on Ubuntu Windows is unable to access or modify the .bashrc file in the user's home directory. This can happen due to a change in file permissions, which restricts the ability of the Bash shell to read or write to the file.

This error can be frustrating because it prevents the user from customizing their Bash environment and may cause unexpected behavior when using the terminal. However, by following the steps outlined below, you should be able to resolve this issue and regain access to your .bashrc file.

💡 Why You Are Getting This Error

  • The primary reason for this error is a change in file permissions that restricts the ability of the Bash shell to read or write to the .bashrc file. This can occur when the file's ownership is changed, its permissions are set to 'read-only', or if there is an issue with the file system.
  • Another possible cause is a conflict between the Bash shell and Windows File Explorer. If Windows File Explorer has modified the file's permissions, it may prevent the Bash shell from accessing the .bashrc file.

✅ Best Solutions to Fix It

Restoring Default Permissions

  1. Step 1: Step 1: Open the Command Prompt as an administrator and navigate to the user's home directory using the 'cd' command. You can do this by typing 'cd ~' (assuming you are in the C: drive).
  2. Step 2: Step 2: Run the command 'chmod u+x ~/.bashrc' to set the ownership of the .bashrc file back to the default user and group.
  3. Step 3: Step 3: Run the command 'chown -R user:group ~/.bashrc' to change the ownership of the .bashrc file to the current user and group. Replace 'user' and 'group' with your actual username and group name.

Resetting Bash Shell Configuration

  1. Step 1: Step 1: Open a new terminal window by typing 'ubuntu' in the Command Prompt.
  2. Step 2: Step 2: Run the command 'source ~/.bashrc' to reload the .bashrc file. This will apply any changes made to the file and reset its permissions.

✨ Wrapping Up

To resolve the '-bash: /home/user/.bashrc: Permission denied' error, you can try restoring default permissions or resetting your Bash shell configuration. If you are still experiencing issues, it may be helpful to investigate further into the cause of the problem and consider seeking additional support.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions