100 Days of Cloud: SSH into an EC2 instance, no instance information returned

I’ve done this task a half dozen times, both on the CLI and in the console. Steps taken:

  1. I’ve made the EC2 instance with the t2.micro image-type and with the correct name.
  2. I waited for the image to be up and running in the Console.
  3. Then I used ssh-keygen to make the id_rsa key pair and stored it in ~/.ssh/, making sure it was added to authorized keys.
  4. Then I imported the keypair into AWS using aws ec2 import-key-pair.
  5. I added a security group rule that allows SSH access from the lab environment’s public IP, found using curl ifconfig.me.
  6. I proved the instance was up and running by SSHing into it using, in the latest attempt, ssh -i ~/.ssh/id_rsa ec2-user@<instance’s public IP address>.

I also attached screenshots proving the instance was made using the correct name, instance-type, and ability to connect over SSH. What’s going on with this exercise? Each time I try it, I wind up with “No instance information returned”




In your examples, I note that you are accessing ec2-user@PUBLIC-IP, rather than root@PUBLIC-IP, which is what the task asks you to do. Did you try to do that? Did it succeed?

I did try to do that, but when I used the AWS Linux image, the CLI told me to connect with ec2-user. When I used an Ubuntu image, I could only connect with ubuntu as the username.

I would look at the contents of the /root/.ssh/authorized_keys file – it can contain content that prevents users from looking in as root, as the task requires. The fix is to empty the file of its previous content, and then paste in the public key you created in the lab terminal. This does work.

Confirmed, it works. That was the step I was missing.

Thank you.