Help Center> Elastic Cloud Server> Troubleshooting> SSH Connection Issues> How Do I Disable Login to an ECS Using SSH Password?
Updated on 2023-03-03 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 and use the SSH password to log in to the ECS. If the message "Disconnected:No supported authentication methods available" is displayed, the SSH password login has been disabled.