How to create Private EC2 Instance in AWS?

Secure deployment of EC2 instance. Accessing the private instance via public instance to reduce the risk level of the servers.

STEP 1: Create a VPC.

STEP 2: Create two subnets inside the VPC “demo-vpc”

Subnet 1:

Subnet 2:

Both the subnets are private until connecting to the internet gateway.

STEP 3: Create an IG [Internet Gateway] and attach it to the VPC.

STEP 4: Check the Route Table and confirm the IG attached properly.

STEP 5: Create a Public EC2 instance by attaching the VPC, subnet, and assign public IP.

STEP 6: Create a Private EC2 instance by attaching the VPC and subnet alone. Disable public IP.

STEP 7: Attach the public instance security group as a source in the private instance.

Now, two instances are configured, one is private [Public IP not assigned] and another one is public.

STEP 8: Change the key permission and try accessing the private instance [172.16.2.186] from the public instance [172.16.1.126].

Successfully logged in !!

Reference:

https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario2.html

https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html

https://docs.aws.amazon.com/efs/latest/ug/gs-step-one-create-ec2-resources.html

For more cyber security tips, hacks and protect your organisation from the ever-evolving threat landscape and targeted attacks, talk to our security consultants right now. https://inservice.sumeru.com/contact-us/

Want to know more about our Cyber Security services? Visit our website https://inservice.sumeru.com/cyber-security/