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年前885ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ