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
posta un anno fa930 visualizzazioni
4 Risposte
0
Risposta accettata

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"
con risposta un anno fa
    • 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
ESPERTO
con risposta un anno fa
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
con risposta un anno fa
  • 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
ESPERTO
Mike_L
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande