From 6eee3e00473fdb0a5cd1720fe09aaf7404337d3f Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Wed, 21 Aug 2019 19:21:58 +0300 Subject: [PATCH] add option to override SSH client version string --- README.md | 3 +++ rsp/__main__.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index c8e1839..3370b60 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ usage: rsp [-h] [-v {debug,info,warn,error,fatal}] [-l FILE] [--disable-uvloop] [-a BIND_ADDRESS] [-p BIND_PORT] [-n POOL_SIZE] [-B BACKOFF] [-w TIMEOUT] [-r CONNECT_RATE] [-L LOGIN] [-I KEY_FILE] [-P PASSWORD] [-H FILE] + [--client-version CLIENT_VERSION] dst_address [dst_port] Rapid SSH Proxy @@ -103,6 +104,8 @@ SSH options: -H FILE, --hosts-file FILE overrides known_hosts file location (default: /home/user/.rsp/known_hosts) + --client-version CLIENT_VERSION + override client version string (default: None) ``` #### Usage examples diff --git a/rsp/__main__.py b/rsp/__main__.py index d3d8f4e..854d532 100644 --- a/rsp/__main__.py +++ b/rsp/__main__.py @@ -88,6 +88,8 @@ def parse_args(): 'known_hosts'), help="overrides known_hosts file location", metavar="FILE") + ssh_group.add_argument("--client-version", + help="override client version string") return parser.parse_args() @@ -97,6 +99,8 @@ def ssh_options_from_args(args, known_hosts): kw['known_hosts'] = known_hosts if args.login is not None: kw['username'] = args.login + if args.client_version is not None: + kw['client_version'] = args.client_version if args.identity is not None: kw['client_keys'] = list(args.identity) if args.password is not None: