# -*- 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("108.174.50.68", 22, "root", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False) cmd = r""" ss -ulnp | grep -E '52300|52000' | head -10 ss -tlnp | grep 52300 | head -5 # check if public iface listens ip -4 addr show | head -20 # iptables INPUT for 52300 iptables -L INPUT -n | head -30 # recheck ready cd /opt/douyinWEB/backend .venv/bin/python - <<'PY' from app import youtube_neko for i in (1,2): s=youtube_neko._container_state(i) print(i, s.get('status'), 'ready', s.get('ready'), 'url', s.get('studio_url')) print('creds', youtube_neko.status_summary(desired=2).get('credentials')) print('nat', youtube_neko._detect_public_ip()) PY # peek compose ports lines grep -A2 'ports:' /opt/douyinWEB/backend/data/neko/docker-compose.yml | head -20 """ stdin, stdout, stderr = c.exec_command(cmd, timeout=60) print(stdout.read().decode("utf-8", "replace")) print(stderr.read().decode("utf-8", "replace")[:500]) c.close()