Anonymous Anonymous - 2 months ago
526 0

No description

Python

tunnel2itb

#!/usr/bin/python

itbuser= "schleimer"
gate= "141.20.65.246"
compute1= "172.30.4.73"

if __name__ == '__main__':
  import sys, json, subprocess
  assert len(sys.argv)>0, "Need a json file with server specs."

  d= json.load(open(sys.argv[1]))
  server= compute1
  ports= [k for j,k in d.items() if "_port" in j]
  for port in ports:
    ps= subprocess.call(["ssh",
    "-N",
    "-L",
    "{}:{}:{}".format(port,server,port),
    "{}@{}".format(itbuser,gate)
    ])
    print(ps)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download