• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. User Guide
  4. ECS Logins
  5. Logging In to a Linux ECS
  6. Login Using an SSH Password

Login Using an SSH Password

Logging in to a Linux ECS using SSH password authentication is disabled by default. If you require password authentication, configure it after logging in to the ECS. To ensure system security, reset the common user password for logging in to the Linux ECS after configuring SSH password authentication.

Prerequisites

Configuring the Login Permission Using SSH Password Authentication

Assigning the remote login permission using SSH key authentication

  1. Use the SSH key to log in to the Linux ECS. For details, see section Login Using an SSH Key.
  2. Run the following command to change the value of PasswordAuthentication in /etc/ssh/sshd_config to yes:

    sudo vi /etc/ssh/sshd_config

    NOTE:

    For the ECSs running the SUSE or openSUSE OSs, ensure that the values of PasswordAuthenticationChallengeResponseAuthentication, and UsePAM in /etc/ssh/sshd_config are all yes.

  3. Run the following command to change the ssh_pwauth value to 1 or true in /etc/cloud/cloud.cfg:

    sudo vi /etc/cloud/cloud.cfg

  4. Run the following command to reload the sshd service:

    sudo service sshd reload

To ensure system security, reset the common user password for logging in to the Linux ECS.

  1. Run the following command to reset the ECS password:

    If the ECS username is linux, run the following command:

    sudo passwd linux

    NOTE:

    To remotely log in to an ECS as user root, perform the following operations:

    1. Run the following command to change the disable_root value to 0 or false and the ssh_pwauth value to 1 or true in /etc/cloud/cloud.cfg:

      sudo vi /etc/cloud/cloud.cfg

    2. Run the following command to set the user root password:

      sudo passwd root

  2. Enter the new password as prompted and press Enter.
  3. Confirm the password and press Enter.
  4. Verify that the information displayed is similar to the following, indicating that the password has been reset:
    passwd: all authentication tokens updated successfully.

Login Operations

  • Windows

    To log in to the Linux ECS from a Windows computer, perform the operations described in this section.

    The following procedure uses PuTTY as an example to log in to the ECS.

    1. Run PuTTY.
    2. Choose Session and enter the EIP of the ECS under Host Name (or IP address).
      Figure 1 Session
    3. Click Window. Then, select UTF-8 for Received data assumed to be in which character set: in Translation.
    4. Click Open.
    5. Enter username and the password you set during ECS creation.
  • Linux

    To log in to the Linux ECS from a Linux computer, run the following command:

    ssh EIP bound to the ECS