Help Center/ Elastic Cloud Server/ Troubleshooting/ SSH Connection Issues/ How Do I Disable Login to an ECS Using SSH Password?
Updated on 2024-08-15 GMT+08:00

How Do I Disable Login to an ECS Using SSH Password?

Scenarios

To ensure ECS security, you need to change the access key of an ECS regularly, or disable the SSH password login.

This section describes how to disable the SSH password authentication.

After disabling SSH password login, you can still log in to the ECS using the password on the ECS console. Keep your password secure.

Procedure

  1. Log in to Linux ECS and run the following command to edit the SSH connection:

    vi /etc/ssh/sshd_config

    Modify the following item:

    Change the value of PasswordAuthentication from yes to no.

  2. Restart sshd for the modification to take effect.

    service sshd restart

  3. Restart the ECS.
  4. Log in to the Linux ECS using an SSH password.

    For details, see Remotely Logging In to a Linux ECS (Using an SSH Password).

    If the login fails, the login to an ECS using an SSH password is disabled.