css,js,ws
This commit is contained in:
15
app/upanel/test.py
Normal file
15
app/upanel/test.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user