SSH to private machines through public bastion – AWS

by Sanjeev on April 13, 2017


  • 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 – Private instance IP –

Test out traditional SSH setup

SSH to the private machine

Ansible setup

Test out

Leave a Comment

Previous post:

Next post: