Files
Miroca_Server/upanel/test.py
Victor Alexandrovich Tsyrenschikov c9ae31bc3d Miroca_Server
2026-01-02 00:07:37 +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