SSH to EC2 instance using boto on private IP through bastion server
问题 I am trying to execute some bash script on EC2 instance using boto . Boto provides a way SSH to EC2 instance on public IP but in my case the instances have only private IP. The way SSH is done on these instance is using a host which can SSH on all the instance using private IP (Bastion host). Following is the script to connect to instance on public IP: s3_client = boto3.client('s3') s3_client.download_file('mybucket','key/mykey.pem', '/tmp/mykey.pem') k = paramiko.RSAKey.from_private_key_file