| 1234567891011 |
- import paramiko
- c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- c.connect(hostname="139.159.253.131", username="root", password="bofang666.", timeout=25)
- for cmd in [
- "ss -ltnp | grep 3000",
- "ps aux | grep -i '[g]ogs' | head -3",
- "find / -maxdepth 6 -name 'gogs' -type f 2>/dev/null | head -5",
- ]:
- _,o,e = c.exec_command(cmd, timeout=50)
- print(f"$ {cmd}\n{o.read().decode()[:800]}\n---")
- c.close()
|