# Cannot SSH into newly launched Rocky Linux 9.1 on AWS

**URL:** <https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272>\
**Category:** Rocky Linux Help & Support\
**Created:** [March 21, 2023, 12:04am UTC](https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272 "2023-03-21T00:04:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmk](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mmk](https://forums.rockylinux.org/u/mmk)\
**Post date:** [March 21, 2023, 12:04am UTC](https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272/1 "2023-03-21T00:04:10Z")

</div>

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:

> [@Can’t do SSH RockyLinux9 in AWS by using TTL](https://forums.rockylinux.org/t/can-t-do-ssh-rockylinux9-in-aws-by-using-ttl/8219):
>
> I put “rocky” for the default user but I couldn’t login through AWS. I subscribed an official Rocky Linux 9 (Official) - x86\_64 instance through AWS Marketplace. Is this default user appropriate? or Do I need to do something??

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?

Anyone may feel free to try it on AWS and see.

---

<div class="post-metadata">

**Author:** ![neil](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/neil/32/34_2.png) [@neil](https://forums.rockylinux.org/u/neil)\
**Post date:** [March 21, 2023, 12:23am UTC](https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272/2 "2023-03-21T00:23:48Z")

</div>

Hello,

I just launched a t3.medium instance from that image with the following key:

```auto
# ssh-keygen -lf ~/.ssh/ord-dev-neil.pem
2048 SHA256:0MURaygO9XG7T4KTGTiFcg6vUzHQskxclSy3WSldh9A no comment (RSA)

```

I then ssh’d to this instance:

```auto
# ssh -i ~/.ssh/ord-dev-neil.pem rocky@18.221.70.52
Warning: Permanently added '18.221.70.52' (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
[rocky@ip-172-31-34-82 ~]$

```

How are you supplying the key to the image?

---

<div class="post-metadata">

**Author:** ![mmk](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mmk](https://forums.rockylinux.org/u/mmk)\
**Post date:** [March 21, 2023, 1:00am UTC](https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272/3 "2023-03-21T01:00:49Z")

</div>

Thanks for the quick reply. The keys were generated from AWS console launching config page. I’ll try again.

---

<div class="post-metadata">

**Author:** ![mmk](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mmk](https://forums.rockylinux.org/u/mmk)\
**Post date:** [March 21, 2023, 2:29am UTC](https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272/4 "2023-03-21T02:29:52Z")

</div>

Now it worked. Strange - maybe an AWS provision glitch. I’ll post back if it happens again. Thanks you!

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:21am UTC](https://forums.rockylinux.org/t/cannot-ssh-into-newly-launched-rocky-linux-9-1-on-aws/9272/5 "2023-08-25T03:21:03Z")

</div>


