Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Product Version: 9.0
Last Modified: 27 September 2019

Problem

When recovering files to an Amazon EC2 instance, the connection to the server fails for the default user with an error message informing stating that the credentials are incorrect.

Background

Every Amazon EC2 Linux instance launches with a default system user account with administrative access to the instance.

The name of the default user depends on the operating system. Please refer Refer to the Connecting to Your Linux Instance Using SSH topic for details. The default user password  is is the name of the Amazon EC2 instance.

An AMI provider can provide a custom default instance username. If your instance was launched from a custom AMI, please contact the AMI provider to get the default username and password.

It may occur that on On a newly deployed Amazon EC2 instance, the password for the default user is may be locked.

Solution

If you encounter the Incorrect credentials for EC2 Recovery Server error,

...

check the status of your default user password with the following command:

passwd -S <default_username>

...

There are several ways to solve the problem of a locked password:

  • Remove the password of the default user. Perform the following command:
    sudo passwd -d <default_username>
    After the password is deleted, log in to the EC2 Linux recovery server with the private key.
  • Create a new password for the default user:
    1. Enable password authentication in the /etc/sshd_config file by adding a string:
      PasswordAuthentication yes
    2. Restart the sshd service:
      /etc/init.d/sshd restart
    3. Enter the command below and follow the command instructions:
      sudo passwd <default_username>
  • Create a new user with a password. Proceed as follows:
    1. Run the command:
      sudo useradd <new_username>
    2. Enter the command below and follow the command instructions to create a password for the newly created user:
      sudo passwd <new_username>