gogs7.py 496 B

1234567891011
  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 in [
  5. "grep -rniE 'git\\.fmode' /etc/nginx/ 2>/dev/null | head -10",
  6. "ls /etc/nginx/conf.d/ 2>/dev/null | head -30",
  7. "grep -rniE 'proxy_pass.*300[0-9]' /etc/nginx/ 2>/dev/null | head -10",
  8. ]:
  9. _,o,e = c.exec_command(cmd, timeout=40)
  10. print(f"$ {cmd}\n{o.read().decode()[:900]}\n---")
  11. c.close()