最初版本

This commit is contained in:
sa19840531
2026-08-15 14:51:51 +08:00
parent 4e01df4dce
commit ea47ea4449
176 changed files with 21009 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import os
import paramiko
pw = os.environ["DEPLOY_PASSWORD"]
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("20.191.152.26", username="wakka", password=pw, timeout=30)
cmds = [
"ls -la ~/.ssh/ 2>/dev/null; cat ~/.ssh/id_ed25519.pub 2>/dev/null; cat ~/.ssh/id_rsa.pub 2>/dev/null",
"ssh -o BatchMode=yes -o ConnectTimeout=8 wakka@100.31.73.254 hostname 2>&1",
"ssh -o BatchMode=yes -o ConnectTimeout=8 root@100.31.73.254 hostname 2>&1",
"ssh -o BatchMode=yes -o ConnectTimeout=8 ubuntu@100.31.73.254 hostname 2>&1",
"for k in ~/.ssh/id_ed25519 ~/.ssh/id_rsa; do [ -f \"$k\" ] && ssh -i \"$k\" -o BatchMode=yes -o ConnectTimeout=8 root@100.31.73.254 hostname 2>&1; done",
]
for cmd in cmds:
print("===", cmd[:90])
_, o, e = c.exec_command(cmd, timeout=30)
print(o.read().decode())
err = e.read().decode()
if err.strip():
print("ERR:", err[:200])
c.close()