Unable to connect to the AWS EC2 instance using any method

0

I am running the free t2.micro instance. Since last night I have been unable to connect to the instance using any method. I've tried using Termius, Terminal, and the built-in console, but none work. My dashboard says the server is online and connectable though. I can't ask for support directly because of the aforementioned free tier. What should I do? I did reboot and stop & restart my instance but nothing works.

Abhinay
질문됨 일 년 전902회 조회
4개 답변
0
수락된 답변

Based on this msg "EC2 Instance Connect is unable to connect to your instance" it look like there is a network misconfiguration of hardware failure. Can you confirm following:

  1. Check is system Status check is "2/2 checks passed"
  2. Check if you can telnet 22 port of server. If telnet works share the output of "ssh -v -i key.pem ubuntu@SERVER.IP"
  3. Check if 22 port is not blocked. use nmap like this "nmap SERVER.IP -Pn -p 22"
답변함 일 년 전
    • system Status check is 2/2 checks
    • telnet 22 port of server : telnet: Unable to connect to remote host: Connection timed out
    • nmap 22/tcp status filtered ssh

    i did install ufw and entered following command

    sudo apt-get install ufw -y sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 'Nginx HTTPS' sudo ufw allow 'Nginx Full' sudo ufw enable -y

0

Hi,

There could be many reasons why you can't access your EC2 instance, could you attach the error message so we can help you more precisely?

On the other hand, I recommend you take a look at the following Knowdlege Center article, specially to the Troubleshoot common errors sections, which explains how to troubleshoot issues to connect to an Amazon EC2 Linux instance using SSH, based on your error message.

profile picture
전문가
답변함 일 년 전
0

Check if you have internet gateway attached to a VPC, without it you will not be able to connect to EC2 instance.

profile picture
답변함 일 년 전
  • I have an internet gateway attached to my VPC and its state is "attached", it was working fine few days back

0

As per your comments, you installed UFW and only allow HTTP/HTTPS (Nginx) incoming. You did not allow incoming SSH at port 22.

i did install ufw and entered following command

sudo apt-get install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 'Nginx HTTPS'
sudo ufw allow 'Nginx Full'
sudo ufw enable -y

If you are running a OS (operating system) with SSM agent installed, you may be able to connect via SSM Session Manager. Try the steps at Connect to your Linux instance using Session Manager. You may need to reboot your EC2 instance for session manager to work.

AWS
전문가
Mike_L
답변함 일 년 전

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

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

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

관련 콘텐츠