import paramiko from pathlib import Path c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("82.157.112.245", username="ubuntu", password="Xiao4669805", timeout=20) cmd = """ ls -la /etc/letsencrypt/live/admin.nomadro.cn/ 2>&1 echo '---' sudo cat /www/server/panel/vhost/nginx/admin.nomadro.cn.conf echo '---' curl -sI https://admin.nomadro.cn/ | head -10 curl -s http://admin.nomadro.cn/ | head -c 80 echo """ _, o, _ = c.exec_command(cmd) Path("deploy/admin-debug.txt").write_text(o.read().decode("utf-8", "replace"), encoding="utf-8") c.close() print("ok")