Connect to Private subnet Ec2 Instance via Public subnet
Connect to Private subnet Ec2 Instance via Public subnet
● Go to Public Route Table and attach the IGW as the target for 0.0.0.0/0
○ Assign public IP
2. Private Instance:
○ Security Group: allow SSH (port 22) from the Bastion Host's security group
1) By assigning IGW
2) By login with a bastion host
So here we are going to login with a bastion host where we need to follow below procedure
1) Copy the content of Key pair which is attached while creating the private machine.
2) Now login to public instance which will act as bastion host and create a file by pasting the
copied data in it in it and further this file will be act as a key pair for private machine.
3) Now change the file permission to read only and use the ssh command to login.
4) Here in the ssh we need to use private IP instead of public IP to login.
Change of file permission
Now we logged in Private Ip but unable to perform ping operation as shown below
So to enable this we need to get in to security group of private subnet machine and we need to add
custom ICMP port hence enabling to perform that action as shown below.