Skip to content

Lightsail SSH - Connection (Request) Port 22: Connection timed out Issue .

0

Hi I'm experiencing a "SSH Connection timed out" in Lightsail. The timed out code is "client_timeout 776" I'm 3 days behind I'll spend 2-3 hrs trying to find the solution, I've lost count how many Instances I had to delete and started over and this keeps reoccuring. The SSH browser does nothing just sits there. I pinged in Powershell and shows connnection timed out... I'm just over this right now.

Enter image description here

asked a year ago518 views

2 Answers
1

Hi, I can see that you are trying to ping to the instance but to my knowledge, in order to ping a instance you need to have ICMP port open for your instance. If you need to ping the server can you verify that your instance has inbound port open for ICMP.

Regarding the SSH issue, can you tell what exactly you did when you encountered the issue? at times I have faced the issue due to the low instance capacity which can be solved simply by changing the lightsail instance to one of higher capacity.

answered a year ago

0

I understand your frustration with the recurring SSH connection timeout issue in Lightsail. This is a common problem that can have several causes. Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Check your instance status in the Lightsail console to ensure it's running and healthy.

  2. Verify that your instance's firewall settings allow SSH connections. Make sure port 22 is open for inbound connections in the networking tab of the Lightsail console.

  3. Monitor your instance's resource utilization. High CPU or memory usage can impact SSH responsiveness. You can view resource metrics in the Lightsail console.

  4. Review the system logs on your instance for any errors or warnings related to SSH connections when you're able to access it.

  5. Try rebooting the instance from the Lightsail console. If that doesn't work, try stopping and starting the instance (note that this will change your public IP unless you're using a static IP).

  6. It's possible that an OS-level firewall is blocking SSH access. When you can access the instance, you could try running a script to disable the firewall and reset iptables:

    sudo ufw disable sudo iptables -F sudo mv /etc/hosts.deny /etc/hosts.deny_backup sudo touch /etc/hosts.deny sudo systemctl enable sshd sudo systemctl restart sshd

  7. If the problem persists, consider creating a snapshot of your instance's root volume. This will allow you to recover your data and potentially attach it to a new, functioning instance.

  8. You might also want to try upgrading to a larger Lightsail plan, as resource constraints could be causing the issue.

If none of these steps resolve the problem, it may be worth contacting AWS Lightsail support for further assistance. They can help identify any underlying issues with the instance or host system that aren't visible to you as a user.

Remember, intermittent issues can be challenging to diagnose, so consistent monitoring and logging when the problem occurs can be helpful in identifying the root cause.
Sources
Lightsail SSH connect timing out | AWS re:Post
lightsail Django can not connect with SSH sometime. | AWS re:Post
Lightsail instance keeps timing out | AWS re:Post
Can not connect to lightsail server even on web ssh, port is open | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.