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)
Possible Causes
The local key does not match or the permission on the local key file is incorrect.
Solution
- 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
- If the information below is displayed, remote SSH is normal. The key may be incorrect. In this case, go to 2.
Figure 3 Terminal result example
- If the preceding information is not displayed, rectify the fault by referring to the following documents:
- If the information below is displayed, remote SSH is normal. The key may be incorrect. In this case, go to 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.
- macOS:
- 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:
- 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
- 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.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot