# -*- coding: utf-8 -*- import paramiko script = """import sys, json sys.path.insert(0, '/opt/douyinWEB/backend') from app import db s = db.get_settings_map() keys = [k for k in s if any(x in k.lower() for x in ('cookie','studio','sapisid','session_token','google'))] print('matching keys', keys) for k in keys: v = str(s.get(k) or '') print(k, v[:80] + ('...' if len(v)>80 else '')) """ c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("107.173.30.245", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False) _, o, e = c.exec_command(f"cd /opt/douyinWEB/backend && .venv/bin/python - <<'PY'\n{script}\nPY", timeout=60) print(o.read().decode("utf-8", "replace")) c.close()