There are many ways using which we can connect to a compute instance running on private subnet and having only private subnet. We can use OCI Bastion service, Secure shell and for enterprise level, we can leverage FastConnect & IPSecVPN. In my previous post Connect to private compute instance, i have shown, how we can connect to a compute instance running on private subnet using public load balancer. The objective of this post is to show, how we can connect to a compute instance running on private subnet using a compute instance running on public subnet in same VCN. This method is very helpful, wherein if we want to do some POCs and want to connect to private compute instance from our desktop machine locally.
Steps:- I have a VCN named as TEST and inside that i have two subnets one is private and another one is public.
The public subnet has the default security list attached and default route table with Internet gateway enabled. Next, i created two compute instance, one in public subnet and another one in private subnet.
Now, i will connect to the compute instance on public subnet using putty and i will place the public key in rsa format(for private subnet) in some directory