Monday, 20 August 2018

How to Setup Password Authentication For AWS ec2 Instances

How to Setup Password Authentication For AWS ec2 Instances

Set the password for root user

  1. Login to SSH using  .pem file
  2. Change user as root user.
    sudo su
  3. Go to ssh config file
    vi /etc/ssh/sshd_config
  4. Change the following var in ssh config
    PasswordAuthentication yes
    PermitRootLogin yes
  5. Change the Root password
    passwd root

    It will prompt the password, you need to provide the password two time.
  6. ReStart the server
    service sshd restart

Now, you can login to EC2 instance with password .

Note: we have set the password for root user not for ec2-user