- Newest
- Most votes
- Most comments
Hi,
Could you try to follow this doc: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-ssh-using-terminal.html to ssh to your instance with your local SSH client.
In the meantime, you can use -v with your ssh command like ssh -v username@hostname, it will prompt you the reason for any connection failure.
Thank you
Based on the information provided, it appears you're experiencing a common issue with AWS Lightsail instances becoming inaccessible. This can happen unexpectedly and for various reasons. Here are some potential causes and additional troubleshooting steps you can try:
-
Firewall issues: The problem may be caused by a firewall on the Lightsail OS blocking SSH access. To address this, you can try running a set of commands in the startup script when restoring from a snapshot. These commands include disabling the firewall, flushing iptables, and restarting the SSH service.
-
OS-level problems: There might be issues with the operating system that are preventing proper startup or network connectivity. Creating a snapshot and launching a new instance from it can sometimes resolve these problems.
-
Resource constraints: If your application has grown and is consuming more resources than available, it may cause connectivity issues. Try creating a new instance with a larger plan to see if that resolves the problem.
-
Service configuration: The SSH service might not be starting properly. Ensure that the SSH service is enabled and configured correctly.
-
Network adapter issues: In some cases, network adapter problems can cause connectivity issues. Restarting the instance or creating a new one from a snapshot can often resolve this.
If none of these steps work, you may need to:
- Create a snapshot of the instance's root volume to preserve your data.
- Attach this snapshot to a new, accessible instance to recover your data.
- Contact AWS Support for further assistance, providing them with details about your instance and the steps you've already taken.
Remember that while these issues can be frustrating, they are usually resolvable with the right troubleshooting steps or assistance from AWS support.
Sources
Lightsail instance stopped to be reacheable from internet | AWS re:Post
Can not connect to lightsail server even on web ssh, port is open | AWS re:Post
Lightsail AWS Can't Access SSH on browser | AWS re:Post
Cannot connect to my AWS Lightsail server | AWS re:Post
Relevant content
asked 2 years ago
asked 3 years ago
asked 3 years ago

Sometimes, an OS-level (ubuntu) firewall is blocking SSH port access, you can follow the accepted answer on this post to restore an instance from snapshot to regain access to ssh https://repost.aws/questions/QU41uDI00gSaqxeAde65rCYA/i-locked-myself-out-of-lightsail-my-ubuntu-container#ANd35xQ4fcTZqVQNzvpN9FIA