Files
WYF-koubo/scripts/ssh_check.py
T
2026-06-19 18:45:55 +08:00

16 lines
638 B
Python

import paramiko, json
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('152.136.232.83', port=22, username='root', password='Jianhua105', timeout=10)
stdin, stdout, stderr = client.exec_command("cat /www/wwwroot/zhinengtiapp/data/sysConfig.json", timeout=10)
out = stdout.read().decode('utf-8', errors='replace').strip()
print("sysConfig.json:", out)
stdin, stdout, stderr = client.exec_command("curl -s http://localhost:3001/api/system/config/public", timeout=10)
out = stdout.read().decode('utf-8', errors='replace').strip()
print("\nEndpoint response:", out)
client.close()