| 123456789 |
- 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 [
- "grep -niE 'git\\.fmode|gitlab|gogs' /etc/haproxy/haproxy.cfg | head -20",
- ]:
- _,o,e = c.exec_command(cmd, timeout=40)
- print(f"$ {cmd}\n{o.read().decode()[:1500]}\n---")
- c.close()
|