Help Center/ ModelArts/ Troubleshooting/ DevEnviron/ SSH Faults/ Error "Bad permissions/Permission denied (publickey)" Is Displayed When a Notebook Instance Is Connected Using SSH
Updated on 2025-11-18 GMT+08:00

Error "Bad permissions/Permission denied (publickey)" Is Displayed When a Notebook Instance Is Connected Using SSH

Symptom

When you connect to a notebook instance using SSH, the following error is displayed:

Bad permissions/Permission denied (publickey)
Figure 1 Error message example

Possible Causes

The local key does not match or the permission on the local key file is incorrect.

Solution

  1. Run the following command in JupyterLab to check whether the SSH server is normal:
    $CONDA_BIN/python $COMMON_DIR/ssh_availability_check.py
    Figure 2 Terminal command example
  2. Check whether the permission on the local key file is incorrect.
    • macOS:
      Figure 4 Connection error example
      If the preceding error information is displayed, run the following command to change the permission:
      chmod 600 ${<key-file-path>}
    • Windows:
      Figure 5 Connection error example

      If the preceding error information is displayed, save the key file to the C:/user/{<username>} directory or its subdirectory. Only the current user has the access permission.

    If the error persists, go to 3.

  3. Check whether the key is the one you configured or whether the key name is duplicate.

    You can stop the notebook instance first, create a new key and bind it to the notebook instance, restart the notebook instance, and then use SSH to connect to the notebook instance again. If the connection is normal, the key may not match. Perform the following operations to determine the mismatch cause:

    1. View the key name. To do so, log in to the ModelArts console, access the notebook instance details page, and view the value of Authentication.
      Figure 6 Notebook instance details page

    2. Check whether the key name is duplicate. To do so, log in to the DEW console, choose Key Pair Service from the navigation pane. In the Account Key Pairs tab, check whether a key with the same name exists in other regions.
      Figure 7 Account key pair

      If the key does not match or its name is duplicate, replace it with a correct one.