I ran ssh-keygen
Post that i am using ssh-copy-id -i /root/.ssh/id_rsa.pub root@<machine-ip>
Although telnet on same port is working while ssh-copy-id
is failing saying
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
I did ssh-add id_rsa
and even ssh-add -l
shows this key as added.
Here my purpose is to setup ansible connection as soon as ec2 machine comes up.