if you changed by mistake the setting of the file /etc/ssh/sshd_config
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication no
to
PasswordAuthentication yes
#PermitEmptyPasswords no
#PasswordAuthentication no
Now you cant login to ec2-user with the certificate.
it ask you to enter the password but you dont have the password
Solution:
login to server using -i
ssh -i ForgeRock.pem ec2-user@my.ip
It will let you login using the .pem file and it will not ask you for the password.
Now you can change the file /etc/ssh/sshd_config and restart the service
systemctl restart sshd