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
已提问 1 年前930 查看次数
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"
已回答 1 年前
    • 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
专家
已回答 1 年前
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
已回答 1 年前
  • 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
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则