gogs5.py 519 B

12345678910
  1. import paramiko
  2. c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  3. c.connect(hostname="139.159.253.131", username="root", password="bofang666.", timeout=25)
  4. for cmd,to in [
  5. ("ls /etc/haproxy/ 2>/dev/null; ls /opt/*.cfg /etc/haproxy*.cfg 2>/dev/null",30),
  6. ("cat /etc/haproxy/haproxy.cfg 2>/dev/null | grep -nE 'frontend|backend|server |bind |acl |use_backend' | head -60",30),
  7. ]:
  8. _,o,e = c.exec_command(cmd, timeout=to)
  9. print(f"$ {cmd}\n{o.read().decode()[:2500]}\n---")
  10. c.close()