SSH Cannot Be Used and the Error "Permission denied (publickey)" Is Displayed After the Permission on the /home/ma-user/.ssh Directory Is Changed
Symptom
The permissions on the /home/ma-user/.ssh directory were changed. As a result, the notebook instance could not be connected using SSH, and the following error was displayed:
Permission denied (publickey)
Possible Causes
The permissions on the /home/ma-user and SSH directories on the server are incorrect. The following figure shows an example of incorrect permissions.


Solution
You can use either of these methods to solve the problem:
- Delete the /home/ma-user/.ssh directory when creating the image. You do not need to set up SSH; it is automatically generated when the notebook starts.
- Run the following commands to change the permission on the .ssh file:
# Set the permission on the /home/ma-user directory to 750. chmod 750 /home/ma-user chmod 750 ~/.ssh chmod 644 ~/.ssh/authorized_keys chmod 640 ~/.ssh/environment chmod 750 ~/.ssh/etc chmod 640 ~/.ssh/known_hosts chmod 750 ~/.ssh/var chmod 600 ~/.ssh/etc/ssh_host_rsa_key chmod 640 ~/.ssh/etc/ssh_host_rsa_key.pub chmod 750 ~/.ssh/etc/sshd_config chmod 750 ~/.ssh/var/run/sshd.pid
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