Enable password authentication for Amazon Linux EC2 Instance

The default user for Amazon Linux 2 is ec2-user, first, we need to create a password for the ec2-user

[ec2-user@ip-164 ]$ sudo passwd ec2-user
Changing password for user ec2-user.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Then enable the password authentication for the Login in the SSHD config file

sudo nano /etc/ssh/sshd_config

Find the PasswordAuthentication no 
and set it to yes

Restart the SSHD Service

sudo systemctl restart sshd

Also published on Medium.

Default image
Vignesh A Sathiyanantham
AWS Certified developer with 8 years of extensive experience working for Cloud and Datacenter solutions and leading a small team in a lean startup based on Bangalore, India
Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.