Bad owner or permissions on .ssh/config

This article helps to solve a Bad owner or permissions on .ssh/config issue occurring on a Windows 10 machine when using a terminal emulator like cmder.

Using cmder on a Windows 10 development machine, I noticed issues after I recently added a new user account to the system. It caused permission issues due to the way inheritance of ownership was being handled.

Bad Owner or Permission on .ssh/config

Resolve ‘Bad Owner or Permission on .ssh/config’ issues on Windows 10

To resolve, I did the following to fix up the permission issues that cause a `Bad owner or permissions on C:\\Users\\Peter/.ssh/config` from occurring each time I tried to connect to a remote host within cmder:

Fixing the ‘Bad owner or permissions on .ssh/config’ Issue

Follow these steps in the Windows 10 GUI to resolve the permission issues:

  1. Locate your .ssh folder. It is usually located in C:\Users\ e.g. C:\Users\Peter.
  2. Go to this location with Windows Explorer.
  3. Right click the .ssh folder and click ‘Properties’.
  4. Find and click the ‘Security’ tab.
  5. Then click ‘Advanced’.
  6. Click ‘Disable Inheritance’, click OK.
  7. A warning popup will appear. Click ‘Remove all inherited permissions from this object’.

    Disable Inherited permissions

    Disable Inherited permissions on Windows 10 for a folder.

  8. Click ‘OK’ to close the ‘Advanced Security Settings for .ssh’ window.
  9. You will notice that all users will be removed. Let’s add the owner back. On the same window, click the ‘Edit’ button.
  10. Next, click ‘Add’ to bring up the Select Users or Groups window.
  11. Click ‘Advanced’, then click the ‘Find Now’ button. A list of user results should appear.
  12. Select your user account. In my case, I selected user ‘Peter’.
  13. Then click OK (approximately three times) to close all windows.

Once all that is done, close and open the cmder app again and attempt to connect to a remote SSH host. Hopefully your set up is fixed and the ‘Bad owner or permissions on .ssh/config’ error prompt is gone.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.