Why Does sshd Fail to Be Started on a Linux ECS?
Symptom
The sshd service fails to be started on a Linux ECS, and /var/empty/sshd cannot be accessed.
Scenarios
The operations described in this section apply to ECSs running CentOS 7 or EulerOS. For other Linux OSs, the operations may be different.
Cause 1: Owner of /var/empty/sshd Is Not root
- The sshd service fails to be started, and the journal log records "/var/empty/sshd must be owned by root and not group or world-writable."
- Check the owner of the /var/empty/sshd file.
ll /var/empty/sshd
As shown in the preceding figure, the owner of the /var/empty/sshd file is not root.
- Modify the owner and permissions of the /var/empty/sshd file.
chown -R root.root /var/empty/sshd
chmod -R 711 /var/empty/sshd
- Run the following command to restart the sshd service:
Cause 2: /var/empty/sshd Does Not Exist
- Run the following command to query the failure causes:
- As shown in the preceding figure, the sshd service fails to be started because the /var/empty/sshd file does not exist. Run the following command to manually create the file:
mkdir -p /var/empty/sshd
- Restart the sshd service.
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