adilsonrapozojr
11/13/2017 - 4:29 AM

Paramiko Python - Utilizando JUMP HOST

vm = paramiko.SSHClient()
vm.set_missing_host_key_policy(paramiko.AutoAddPolicy())
vm.connect(IP_GATEWAY, username=USERNAME, password=PASSWORD, auth_timeout=WAIT_TIME)
vmtransport = vm.get_transport()
vmchannel = vmtransport.open_channel("direct-tcpip", (host, 22), (IP_GATEWAY, 22))
jhost = paramiko.SSHClient()
jhost.set_missing_host_key_policy(paramiko.AutoAddPolicy())
jhost.connect(host, username=USERNAME, password=PASSWORD, sock=vmchannel, auth_timeout=WAIT_TIME)
# jhost.execute(...)
jhost.close()