mirror of
https://github.com/anten-ka/kaskad-pro.git
synced 2026-05-21 01:36:01 +00:00
Add TCP ping fallback for servers that block ICMP (XRay, VLESS, Reality)
Made-with: Cursor
This commit is contained in:
23
_ssh_debug.py
Normal file
23
_ssh_debug.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import paramiko, sys
|
||||
|
||||
host = "185.250.47.205"
|
||||
user = "root"
|
||||
pwd = "0i1sbf9NM36FkG5dFH"
|
||||
|
||||
def run(cmd, timeout=30):
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(host, username=user, password=pwd, timeout=10)
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd, timeout=timeout)
|
||||
out = stdout.read().decode(errors="replace")
|
||||
err = stderr.read().decode(errors="replace")
|
||||
rc = stdout.channel.recv_exit_status()
|
||||
ssh.close()
|
||||
return rc, out, err
|
||||
|
||||
if __name__ == "__main__":
|
||||
cmd = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "echo ok"
|
||||
rc, out, err = run(cmd)
|
||||
if out: print(out, end="")
|
||||
if err: print("STDERR:", err, end="")
|
||||
print(f"\n[exit {rc}]")
|
||||
Reference in New Issue
Block a user