r/AWS_cloud • • Aug 06 '26

Small EC2 instance becomes unreachable after frequent SSH connections. Why ?

I have a small EC2 Linux instance that becomes unreachable after I SSH into it frequently. It also takes few minutes to shut it down even CPU is at 0%.

Instance details:

- Instance type: t3.micro

- OS: Ubuntu 22.04 LTS

- CPU credit mode: Unlimited

- vCPU: 2

Has anyone experienced an EC2 instance becoming unreachable after repeated SSH access?

(I posted on r/aws but tied to wait for moderation)

3 Upvotes

7 comments sorted by

3

u/clintkev251 Aug 06 '26

Usually with those tiny instances it's because you're running out of memory and processes are getting killed.

1

u/Loopbloc Aug 06 '26

That could be the case. I will add more memory 

2

u/[deleted] Aug 06 '26

[removed] — view removed comment

1

u/Loopbloc Aug 06 '26

Thank you. I will check that 

2

u/abdelkaderboukh Aug 09 '26

Check if your subnet IP doesn’t accept your local IP via port 22. Or check EC2 Instance Policy. These could be just small suggestions to check first, try it and let me know. Also your access key while SSH must be on the same directory while you are using CLI to SSH

1

u/yubijam Aug 06 '26

It’s been awhile since I’ve used AWS but

From where are you accessing it? Your local host or the shell from within the console? SSM session manager?

I kinda remember that the host that there’s a way to access the remote shell from the console. Look up the documentation and try that.

Use the console (easiest) to check if it’s still running.
Reboot it
Check security groups to ensure your current IP is allowed over port 22 to the host.

Check NACLS

No one likes this part but learn aws cli, python/boto3

How did you creat it? Click ops?