can't connect my ec2 using ssh

0

Failed to connect to your instance EC2 Instance Connect is unable to connect to your instance. Ensure your instance network settings are configured correctly for EC2 Instance Connect. For more information, see Set up EC2 Instance Connect at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html.

some time later, I can't connect with my Ec2 using ssh . ec2 instance connect either . the error as above .

  • Did you try troubleshooting on your own? What have you tried / done?

will
질문됨 8달 전319회 조회
2개 답변
1

Hi, please follow https://repost.aws/knowledge-center/ec2-instance-connect-troubleshooting for detailled guidance on troubleshooting connection with Instance Connect.

It is most often an issue with security or IP routing in your VPC.

Best,

Didier

profile pictureAWS
전문가
답변함 8달 전
profile picture
전문가
검토됨 8달 전
0

Approach 1

Please check the security settings. You might need to add inbound SSH connections from everywhere. If it's all okay, then follow approach two.

Approach 2

    1. Connect to your instance using SSH.
    1. Use the SSH key pair that was assigned to your instance when you launched it and use the default user name of the AMI that you used to launch your instance , for Amazon Linux 2, the default user name is ec2-user
    1. Use the following command to SSH into your instance:

    ssh -i my_ec2_private_key.pem ec2-user@<your instance's public DNS name>

  • Install the EC2 Instance Connect package on your instance. For Amazon Linux 2, use the yum install command.

    sudo yum install ec2-instance-connect

Approach 3

  1. Go to your AWS EC2 console
  2. Select your instance that is not able to connect
  3. Stop your instance
  4. Go to Actions -> Instance Settings -> Edit User Data
  5. Add user data in to update Firewall setting etc in user data
  6. Save this and restart instance.
profile picture
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠