Nat – Connecting a server in a private subnet from a server in the public subnet

amazon-vpcamazon-web-servicesnat;subnet

I created 2 subnets in one AWS VPC. One of them has an internet gateway for routing. The other has a NAT gateway.

I launched 1 instance into the public subnet with a public IP address and the other into the private subnet with only a private IP address.

Now, to make any updates, to install any packages or to configure the server to make it as a database server, how do I access it from the instance in the public subnet(considering the instance in the public subnet to be the application server).

I am not able to SSH to it. I get the error as in this image:ssh-error

Best Answer

Open the port to SSH/RDP to the instance on the Security group, I would lock it down to your IP address, you do not want access to the server open to the world. This works for the public subnet instances, for private instances you can set up a bastion thru the public subnet or a VPN server.

Security Groups

VPN Options