16 lines
564 B
Python
16 lines
564 B
Python
#!/usr/bin/env python3
|
|
import paramiko
|
|
PASS = "Bbt9115xty9176!"
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("10.10.0.10", username="localadministrator", password=PASS, timeout=30)
|
|
for cmd in [
|
|
"sudo cat /etc/systemd/system/cloudflared.service",
|
|
"cloudflared --version",
|
|
"cloudflared tunnel run --help 2>&1 | head -40",
|
|
]:
|
|
print(f"\n=== {cmd} ===")
|
|
_, o, e = c.exec_command(cmd, timeout=30)
|
|
o.channel.recv_exit_status()
|
|
print((o.read() + e.read()).decode(errors="replace")[:4000])
|
|
c.close() |