All Products
Search
Document Center

:Verify required SSH files on a Linux instance

Last Updated:Apr 16, 2026

Missing key files or directories for SSH access can prevent you from logging in to a Linux instance. This topic describes how to check for thesshd_config configuration file if you cannot connect to an ECS instance remotely.

  1. Detach the system disk from the affected ECS instance and attach it to a healthy ECS instance as a data disk.

  2. On the healthy ECS instance, navigate to the directory where the disk is mounted. Switch to the root user and run the following command to check for thesshd_config configuration file.

    ll /etc/ssh/sshd_config
  3. If thesshd_config configuration file does not exist, use thecp command to copy the/etc/ssh/sshd_config file from the healthy ECS instance to the/etc/ssh/ directory on the attached disk.

  4. Follow the instructions in Best practices for data recovery on Linux instances to restore the system disk of the affected ECS instance.

  5. Log in to the repaired ECS instance remotely to verify it is working correctly.