Change ssh-tunnel

This commit is contained in:
2023-08-11 10:45:59 +02:00
parent 6041b5c804
commit deddbc92ca
6 changed files with 74 additions and 43 deletions
+22
View File
@@ -0,0 +1,22 @@
from sshtunnel import SSHTunnelForwarder
import os
filename = os.path.basename(__file__)
server = SSHTunnelForwarder(
("forward.stines.de", 2223),
ssh_username="root",
ssh_password="adm.3dfx12",
remote_bind_address=('127.0.0.1', 3306)
)
def server_start():
server.start()
return print(f"{filename}-Server started")
def server_stop():
server.stop()
return print(f"{filename}-Server stoped")
def server_port():
return server.local_bind_port