Help Center/ ModelArts/ FAQs/ Notebook (New Version)/ Failures to Access the Development Environment Through VS Code/ What Do I Do If Error Message "Bad owner or permissions on C:\Users\Administrator/.ssh/config" or "Connection permission denied (publickey)" Is Displayed?
Updated on 2024-06-11 GMT+08:00

What Do I Do If Error Message "Bad owner or permissions on C:\Users\Administrator/.ssh/config" or "Connection permission denied (publickey)" Is Displayed?

Symptom

The following error message is displayed: "Bad owner or permissions on C:\Users\Administrator/.ssh/config" or "Connection permission denied (publickey). Please make sure the key file is correctly selected and the file permission is correct. You can view the instance keypair information on ModelArts console."

Possible Causes

The permission to the SSH folder has been granted to other users, not only to the current Windows user, or the current user does not have the permission. In these cases, you only need to modify the permission.

Solution

  1. Find the SSH folder, which is typically located in C:\Users, for example, C:\Users\xxx.

    The file name in C:\Users must be the same as the Windows login username.

  2. Right-click the folder and choose Properties. Then, click the Security tab.
  3. Click Advanced. In the displayed window, click Disable inheritance. Then, in the Block Inheritance dialog box, click Remove all inherited permissions from this object. In this case, all users will be deleted.
  4. Add an owner. In the same window, click Add. In the displayed window, click Select a principal next to Principal. In the displayed Select User, Computer, Service Account, or Group dialog box, click Advanced, enter the username, and click Find Now. Then, the search results will be displayed. Select your account and click OK to close all windows.
    Figure 1 Adding an owner
  5. Close and open VS Code again and try to remotely access the SSH host. Ensure that the target key is stored in the SSH folder.