From 8a9f5261904face76f45949fa06a53bd6b3882fb Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 22 Sep 2022 17:51:03 +0300 Subject: [PATCH] ssh_tunnels_config_util: support ssh_port option --- doc/ssh_tunnels_config_util.md | 2 ++ src/ssh_tunnels_config_util.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/ssh_tunnels_config_util.md b/doc/ssh_tunnels_config_util.md index 590f158..97ffcee 100644 --- a/doc/ssh_tunnels_config_util.md +++ b/doc/ssh_tunnels_config_util.md @@ -10,11 +10,13 @@ ssh_bind_base = 21000 [nas1] ipv4 = 100 http_port = 80 +ssh_port = 22 bind_slot = 0 [nas2] ipv4 = 101 http_port = 8080 +ssh_port = 22 bind_slot = 1 ``` diff --git a/src/ssh_tunnels_config_util.py b/src/ssh_tunnels_config_util.py index 986f3ea..3b2ba6e 100755 --- a/src/ssh_tunnels_config_util.py +++ b/src/ssh_tunnels_config_util.py @@ -26,7 +26,7 @@ if __name__ == '__main__': target_host = f'{network_prefix}.{config[tun_host]["ipv4"]}' buf.append(f'-R 127.0.0.1:{http_bind_port}:{target_host}:{config[tun_host]["http_port"]}') - buf.append(f'-R 127.0.0.1:{ssh_bind_port}:{target_host}:22') + buf.append(f'-R 127.0.0.1:{ssh_bind_port}:{target_host}:{config[tun_host]["ssh_port"]}') i += 1