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

How to Fix: WSL Ubuntu ~/ssh/config symlinked to c:\users\USER\.ssh\config permissions error

WSL Ubuntu SSH config permissions issue resolved by changing ownership and permissions.

Quick Answer: Change the ownership of the symlink to the user who created it, then change the permissions to allow read-only access for the group.

The error 'Bad owner or permissions on /home/hardya/.ssh/config' occurs when the symlinking of the Ubuntu SSH configuration file in WSL results in incorrect ownership and permissions, preventing it from being accessed.

This issue is frustrating because it prevents users like Hardya from utilizing their preferred SSH client (WSL Ubuntu) for simple configurations. However, due to its simplicity, this problem can be easily resolved with a few straightforward steps.

💡 Why You Are Getting This Error

  • The primary reason for this error is the incorrect ownership and permissions of the symlinking process. When creating a symlink in WSL, the target directory's ownership and permissions are not automatically transferred to the new location.
  • An alternative cause could be the incorrect handling of file paths by the system. In this case, the issue arises from the fact that the user is trying to link a file located at `/mnt/c/Users/hardya/.ssh/config` instead of `/home/hardya/.ssh/config`.

🚀 How to Resolve This Issue

Changing File Ownership and Permissions

  1. Step 1: Open a command prompt or terminal as the administrator. This will give you elevated privileges to change file ownership and permissions.
  2. Step 2: Navigate to the location where the symlink was created using the `cd` command. For example, `cd ~/.ssh`.
  3. Step 3: Use the `chown` command to set the correct owner of the symlinked file to the user who created it. The syntax is `chown -R username:groupname /path/to/.ssh/config`. Replace 'username' and 'groupname' with your actual username and group name, respectively.
  4. Step 4: Next, use the `chmod` command to set the correct permissions for the symlinked file. The syntax is `chmod 700 ~/.ssh/config`. This will change the ownership and permissions of the file to make it accessible only to the owner.

Using a Different Symlink Location

  1. Step 1: Navigate to the location where you want to create the symlink using the `cd` command. For example, `cd /home/hardya/.ssh`.
  2. Step 2: Use the `ln -s` command to create the symlink in the correct location. The syntax is `ln -s /mnt/c/Users/hardya/.ssh/config ~/.ssh/config`. Replace `/mnt/c/Users/hardya/.ssh/config` with the actual path of your SSH configuration file.
  3. Step 3: This method will create a new symlink at the desired location, avoiding any issues related to incorrect ownership and permissions.

💡 Conclusion

To resolve the 'Bad owner or permissions on /home/hardya/.ssh/config' error, you can either change the file ownership and permissions using elevated privileges or use a different symlink location. Either method will allow you to access your SSH configuration file without any issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions