All Products
Search
Document Center

Simple Application Server:Check whether a Linux simple application server contains the files or directories required by SSH access

Last Updated:Apr 01, 2026

A missing sshd_config file is one of the most common causes of SSH login failures on Linux simple application servers. This topic shows how to check whether the file exists and recover SSH access when it is missing.

Prerequisites

Before you begin, ensure that you have:

  • Access to the Alibaba Cloud console

  • A simple application server that is running

Check for the sshd_config file

  1. Use the rescue feature to connect to the Linux simple application server. For more information, see Connect to a Linux server by using the rescue feature.

  2. Run the following command to check whether the sshd_config file exists:

    ll /etc/ssh/sshd_config
    • If the file is missing, the output shows an error similar to the following screenshot. Continue to the next step to recover it.

      image.png

  3. Choose one of the following recovery methods.

Option 1: Copy sshd_config from another server (recommended)

Use this option if you have another simple application server with a working sshd_config file.

  1. Run the following command to copy sshd_config from the working server to this one. Replace <Public IP address of the simple application server that contains the sshd_config configuration file> with the actual public IP address:

    scp root@<Public IP address of the simple application server that contains the sshd_config configuration file>:/etc/ssh/sshd_config /etc/ssh

    For example, if the source server's public IP address is 120.27.XX.XX:

    scp root@120.27.XX.XX:/etc/ssh/sshd_config /etc/ssh
  2. Restart the sshd service to apply the configuration:

    systemctl restart sshd

Option 2: Roll back the system disk based on a snapshot

Use this option if you created a snapshot before the issue occurred and do not have another server to copy sshd_config from.

Follow the steps in the "Roll back a disk based on a snapshot" section in Manage snapshots.

Verify connectivity

After completing the recovery steps, verify that SSH access is restored. For more information, see Connect to a Linux server.