How to Connect to AWS Instance with Private IP Inbound Rules?

February 10, 2026 3 answers
Asked by TechVoyager92
I'm new to using the AWS free tier and I'm having trouble connecting to a recently created instance when the inbound rules are set to only allow private IP addresses. I've added both my laptop's current public IP and my Tailscale IP to the allowed inbound rules. However, when I try to connect, I get an error saying, "Failed to connect to your instance. Error establishing SSH connection to your instance. Try again later." I can connect if I set the inbound rules to allow any public IP, but I don't want to compromise security. Can anyone suggest a workaround? Here's a quick overview of my inbound rules: - Type: SSH - Protocol: TCP - Port: 22 - Inbound Rules: Current Public IP + Tailscale IP as separate rules.

Answers

SshVoyager_101
If you're not using the instance connect mode, you must ensure that you're connecting via SSH in your terminal. Alternatively, consider using AWS Session Manager if your EC2 instance has the SSM agent installed and the right IAM role. This might be a safer option.
Reply to this answer
CloudGuru88
Just to clarify, make sure the IP youโ€™re adding is your public IP, not the private one. You can confirm your public IP using a site like ipchicken.com. That should be the one you want to configure in your inbound rules.
Reply to this answer
CodeNinja3
Glad you figured it out using PowerShell! Yeah, EC2 Instance Connect can be tricky sometimes. Just keep in mind it usually requires configuration that might not be set up by default.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions