After launching a new instance on AWS with image “Rocky Linux 9 (Official) - x86_64 Ver 9.1.20230215”, I cannot SSH into the instance with user “rocky” and the private key. Tried different SSH keys (RSA, ed25519, with length 2048, 3072) as suggested in this post but none worked:
This is reproducible when I retried launching new instances. I detached the EBS volume then attached it to a CentOS Stream 9 instance, and saw file /home/rocky/.ssh/authorized_keys is actually empty. Bug?
I just launched a t3.medium instance from that image with the following key:
# ssh-keygen -lf ~/.ssh/ord-dev-neil.pem
2048 SHA256:0MURaygO9XG7T4KTGTiFcg6vUzHQskxclSy3WSldh9A no comment (RSA)
I then ssh’d to this instance:
# ssh -i ~/.ssh/ord-dev-neil.pem email@example.com
Warning: Permanently added '22.214.171.124' (ED25519) to the list of known hosts.
[rocky@ip-172-31-34-82 ~]$ sudo ls -altr /root/original-ks.cfg
-rw-------. 1 root root 5289 Feb 15 18:06 /root/original-ks.cfg