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.