Files
Miroca_Server/app/upanel/test.py
Victor Alexandrovich Tsyrenschikov 4609cbfb21 css,js,ws
2026-01-02 21:44:28 +05:00

15 lines
413 B
Python

from sshtunnel import SSHTunnelForwarder
import os
hostname = "192.168.88.3"
response = os.system("ping -c 1 " + hostname)
if response == 0:
ssh_tunnel = SSHTunnelForwarder(
'192.168.88.3',
ssh_username="orangepi",
ssh_password="cbvgcjy0",
remote_bind_address=('192.168.88.3', 22)
)
ssh_tunnel.start()
print(ssh_tunnel.local_bind_port) # show assigned local port