# -*- coding: utf-8 -*- import sys import paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("192.227.152.110", 22, "root", "Leaf448772566", timeout=30, allow_agent=False, look_for_keys=False) cmds = [ "cat /etc/nginx/conf.d/gitea.conf", "ls /etc/letsencrypt/live 2>/dev/null; ls /root/.acme.sh 2>/dev/null | head; command -v certbot; command -v acme.sh; ls /etc/ssl/certs | head", "which ffmpeg || echo no-ffmpeg; dpkg -l | grep -E 'python3-venv|python3-pip' | awk '{print $2,$3}'", ] for cmd in cmds: print("\n===== ", cmd[:80], " =====") _, o, e = c.exec_command(cmd, timeout=20) print((o.read() + e.read()).decode("utf-8", "replace")[-8000:]) c.close()