0

I am using the below command to access my instance. How can I achieve the same in python3? ssh -i <aws_private_key> ec2-user@<aws_instance_private_ip> -o "proxycommand ssh -W %h:%p -i <aws_private_key> ec2-user@<bastion_node_ip>"

I have to run some commands after accessing the instance.

Thanks.

saranjeet singh
  • 868
  • 6
  • 17
Nilesh
  • 39
  • 2
  • 5
  • Relevant : https://stackoverflow.com/questions/42645196/how-to-ssh-and-run-commands-in-ec2-using-boto3 – saranjeet singh Aug 04 '20 at 11:59
  • I already looked into that thread and in that thread, public IP of instance needs to use. In our case, we have to use private IP so we need bastion node IP as well. – Nilesh Aug 04 '20 at 12:50

0 Answers0