SSH to private machines through public bastion – AWS

by Sanjeev on April 13, 2017

Assumptions:

  • You have an EC2 machine setup in a private subnet.
  • Bastion host setup in a public subnet.
  • Security groups setup to allow required access.
  • You have access to private keys for both the machines

Below is the setup for ansible to use bastion host in order to run playbooks against a private instance

Bastion instance IP – 204.26.25.206 Private instance IP – 192.1.4.248

Test out traditional SSH setup

SSH to the private machine

Ansible setup

Test out

Leave a Comment

Previous post:

Next post: