How Enable Username & Password Authentication for Linux EC2

How Enable Username & Password Authentication for Linux EC2

June 29, 2020 / Nirav Shah

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

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let Us Talk About Your AWS Development Requirements

    Have queries about your AWS project ideas and concepts? Please drop in your project details to discuss with our AWS experts, professionals and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project