SSH timeout AWS EC2

1

I do have an AWS EC2 and I'm unable to connect by SSH. Port 22 is open in the default AWS firewall (with my IP).

I keep getting: Operation timed out

I suspect that UFW or fail2ban block me.

Is there a console in the AWS Panels can let me connect to this instance? Or an another way to connect to be able to unban me?

Thank you.

  • Yes! You are correct; the issue was with the UFW firewall. The SSH rule was denied. Recently, I had been facing this same issue, but eventually, I solved this problem gracefully using this method.

    APPROACH FOR SOLVING THIS ISSUE:

    1. I detached the root volume from this web application instance and attached the volume into another running instance.
    2. Then, I navigated to the instance, mounted a volume to the mount point folder, and navigated into the ufw configuration folder for the volume device.
    3. I modified the rules and reloaded the firewall. Then, I unmounted the volume and detached the volume from this instance, reattached it to the web application instance.
    4. Finally, I tried to SSH. The issue got resolved.

    i have documented step-by-step solution for solving this issue .

    I invite you to read the detailed documentation of this troubleshooting journey

    Document link: [ https://docs.google.com/document/d/1saZM95s5ZF2GgdSPI3wV-cUZiB-3Aprc/edit ]

    during this process any issue , feel free to reach out me in linkdin linkdin id : [ https://www.linkedin.com/in/elamparithi-m-72288625a/ ]

3 Respuestas
2

I think your best option here would be to connect using AWS Systems Manager Session Manager.

Please see the documentation for details on how to connect using Session Manager: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/session-manager.html

AWS
Greg_H
respondido hace 2 años
  • How to install SSM Agent when you cannot connect by ssh?

1
profile pictureAWS
EXPERTO
kentrad
respondido hace 2 años
0

Hello,

  • I try to connect from a different device and IP... Still get a "timeout".
  • I try to connect with "Serial Console", I upload a public key... But I get a "Permission denied" when I try to connect. Please note that I'm on Debian 10 so the "EC2 Instance connect" don't work.

Help please.

picarda
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas