gogs8.py 441 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. "ss -ltnp | grep 3000",
  6. "ps aux | grep -i '[g]ogs' | head -3",
  7. "find / -maxdepth 6 -name 'gogs' -type f 2>/dev/null | head -5",
  8. ]:
  9. _,o,e = c.exec_command(cmd, timeout=50)
  10. print(f"$ {cmd}\n{o.read().decode()[:800]}\n---")
  11. c.close()