By using AWS re:Post, you agree to the Terms of Use

Unable to SSH to new instances unless its an AWS Ami

0

I'm encountering a weird issue. I'm unable to ssh to any instances other than anything thats an AWS AMI, even with default security groups with TCP open on port 22, and the exact same key pairs. All instances are using free tier eligible options). I can provide instance ids if needed to look into these issues further.

I created an instance with an AWS AMI (amzn2-ami-hvm-2.0.20190823.1-x86_64-gp2 (ami-0b69ea66ff7391e80)), newly created key pair (testing; testing.pem), and security group shows open TCP connections on port 22

I then also created an instance with Ubuntu 18.04 AMI (ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20191002 (ami-04b9e92b5572fa0d1)), the same key pair that was used above (testing; testing.pem), and security group shows open TCP connections on port 22.

AWS AMI ssh connection output

 
->> ~/.ssh $ ssh -i testing.pem ec2-user@54.167.74.46
Last login: Mon Oct 21 02:26:43 2019 from [redactedip]
       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
15 package(s) needed for security, out of 31 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-88-246 ~]$ exit
logout
Connection to 54.167.74.46 closed.
->> ~/.ssh $ 

Ubuntu 18/04 ssh connection output

 
->> ~/.ssh $ ssh -i testing.pem ec2-user@184.72.150.242
Connection closed by 184.72.150.242 port 22
->> ~/.ssh $ 

Anything obvious that I'm missing?

Edited by: jackbeanstalk on Oct 20, 2019 8:13 PM : Removed my ip from the login message

asked 3 years ago25 views
1 Answers
0
Accepted Answer

On Ubuntu images, most of the time the login user is ubuntu.. Try this and yous should be able to connect.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions