issue with ssh-copy-id


[centos@ip-192-168-1-100 ~]$ ssh 192.168.1.100
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).



1- By default AWS's EC2 Instance ( Virtual Machine )  use a key pair to log into it ( no password)
2- the default key pair use to log into another machine from the EC2 instance is id_rsa
3- password option is disable for SHHS Demon:  ( etc/ssh/sshd_config ,  PasswordAuthentication yes , service sshd restart )


The easier is to use the same EC2 key pair as id_rsa: 

cp EC2keypair  .ssh/id_rsa

chmod 0600 .ssh/id_rsa

#ssh-copy-id 192.168.1.100 ( it's not needed because we already use the same key pair from AWS )

ssh 192.168.1.100


Other option would be to create an password for the centos user ( AWS centos EC2 instance ) + allow password in SSHD config + restart the process

then ...