2

My deployment aws environment is using bastion host to allow connection to all different aws ec2 machines. I am using paramiko and able to make connection with bastion.

pemkey_path = paramiko.RSAKey.from_private_key_file("xyz.pem")
paramiko_client = paramiko.SSHClient()
paramiko_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print("connecting")
bastion_conn = paramiko_client.connect( hostname = "ec2-xxx.compute.amazonaws.com", username = "ec2-user", pkey = pemkey_path)
print("connected")

Now I want to connect to ec2 instance from this bastion connection and perform some commands to this ec2-instance how can I do this ?

jww
  • 97,681
  • 90
  • 411
  • 885
Karn_way
  • 1,005
  • 3
  • 19
  • 42
  • My problem was solved by the explanation given at http://stackoverflow.com/questions/18968069/paramiko-port-forwarding-around-a-nat-router/19039769#19039769 – Karn_way Jul 20 '16 at 07:22

0 Answers0