Step#1 Edit the ssh configuration file
Open the ssh configuration file in vi editor
Go to the line containing PasswordAuthentication
Uncomment the line
Save and come out of vi editor.
Step#2 Reload ssh configuration file
This would work in RHEL8,7 and CentOS 8 and 7. Older version of Linux, restart using service sshd reload
systemctl reload sshd.service
Step#3 Open AWS Firewall for port 22
In your EC2 instance Security group(SG), add ssh port 22 in inbound rule.
Now, you should be able to login to your Linux instance using a username and password!