How Enable Username & Password Authentication for Linux EC2

How Enable Username & Password Authentication for Linux EC2

June 29, 2020 / Eternal Team

In this blog we will learn about how to set up password on your running instance,

Prerequisites

  • You have ec2 instance running
  • You have root access to ec2 instance

Step 1

Connect to your Linux ec2 instance via putty (/ssh). Here I am connecting via putty.

Enable Username  & Password Authentication for Linux EC2

Step 2

Login to your running instance

Enable Username  & Password Authentication for Linux EC2

Step 3

Execute below command:

sudo passwd ec2-user

And write the password

Enable Username  & Password Authentication for Linux EC2

Step 4

Now it’s time to go to the directory

/etc/ssh

and follow below command

sudo vim sshd_config 

Enable Username  & Password Authentication for Linux EC2

Step 5

After you apply the command, you will see windows like this

Enable Username  & Password Authentication for Linux EC2

Press “i” and

Now go to the “passwordauthentication” and write “yes”

After change, it please save it

Perfect

Step 6

Last command is

sudo service sshd restart

Enable Username  & Password Authentication for Linux EC2

and disconnect and login again using username and password You will see like this,

Enable Username  & Password Authentication for Linux EC2

AWS-Consulting-Partner

Talk to AWS Certified Consultant

    Want to start a project?

    It’s simple.

    Contact us