One minute
SSH Permission Denied Error on EC2 Instances
Generate a new key from the source EC2 server [e.g. Ansible Master Node].
$ ssh-keygen
Change the permission for the generated keys
$ chmod 600 id_rsa.pub
$ chmod 600 id_rsa
Copy the id_rsa.pub key entry to the authorized_keys in the target servers [e.g. Host Node]
When trying to connect to the target server, a permission denied error occurs:
To resolve, I changed the permission of the authorized_keys in the target server.
$ chmod 600 authorized_keys