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.

Leave a Reply

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

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading