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

0
4
Asked By TechieGiraffe97 On

I'm trying to connect to a new AWS instance for the first time using the free tier, but I'm having trouble when setting the inbound rules to allow only private IP addresses. I've added both my laptop's current public IP and my Tailscale IP to the allowed inbound rules but keep getting 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 that isn't secure. How can I resolve this issue? Here are the details I've set for the inbound rules: Type SSH, TCP protocol, port 22, with my current IP and Tailscale IP as separate rules.

3 Answers

Answered By CuriousCoder22 On

Just to clarify, when you mention 'my laptop's current IP', are you referring to your public IP? Make sure you're using that, because your instance won't recognize a private IP from your laptop to connect.

TechieGiraffe97 -

Yes, I'm using my public IP. I also tried adding the Tailscale IP as a backup, but that didn't help. Just stuck here.

Answered By DevGuru44 On

If you’re using the instance connect mode, remember that your source IP must be from the instance connect IP range that AWS provides. Since you want to access the instance via SSH, ensure your setup is right. You can also try using the session manager feature, but be aware that you'll need the SSM agent installed and an IAM role for your EC2 to interact with SSM.

TechieGiraffe97 -

I actually managed to connect via PowerShell and terminal, but the EC2 instance connect option didn’t work at all.

Answered By CloudNinja88 On

Have you checked your real public IP using a site like whatsmyip? That might help ensure you're using the correct address in your inbound rules.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.