diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2022-02-25 20:58:06 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2022-02-25 20:58:06 +0000 |
commit | b277af9cb84c7f42c088f17ed0036bda6aeacdf4 (patch) | |
tree | fbff39db45995a063cd3565d149661f0e5ec3cd6 /tunnel.py | |
parent | 0c284f018029b102c536068689248fa6e8c0d424 (diff) | |
download | ReverseSSHTunnel-b277af9cb84c7f42c088f17ed0036bda6aeacdf4.tar.gz ReverseSSHTunnel-b277af9cb84c7f42c088f17ed0036bda6aeacdf4.zip |
added dockerfiles
Diffstat (limited to 'tunnel.py')
-rw-r--r-- | tunnel.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4,11 +4,14 @@ import subprocess CONFIG = configparser.ConfigParser() CONFIG.read("tunnel.conf") -cmd = ["ssh", "-nNTv"] +cmd = ["autossh", "-nNTv"] if CONFIG.has_option("server", "ssh_port"): cmd += ["-p", CONFIG.get("server", "ssh_port")] +if CONFIG.has_option("server", "keyfile"): + cmd += ["-i", CONFIG.get("server", "keyfile")] + for section in CONFIG.sections(): if section.startswith("forward"): cmd += ["-R", "%s:%s" % (CONFIG.get(section, "to"), CONFIG.get(section, "from"))] @@ -16,3 +19,4 @@ for section in CONFIG.sections(): cmd.append(CONFIG.get("server", "host")) print("Using command: " + " ".join(cmd)) +subprocess.run(cmd) |