diff --git a/blessclient/client.py b/blessclient/client.py index 895a15d..5774e39 100755 --- a/blessclient/client.py +++ b/blessclient/client.py @@ -1048,12 +1048,14 @@ def main(): ) parser.add_argument( 'host', - help=('Host name to which we are connecting'), + help=( + 'Host name to which we are connecting'), nargs='*' ) parser.add_argument( '--region', - help=('Region to which you want the lambda to connect to. Defaults to first region in config'), + help=( + 'Region to which you want the lambda to connect to. Defaults to first region in config'), default=None ) parser.add_argument( diff --git a/blessclient/user_ip.py b/blessclient/user_ip.py index fd72037..2ffbc06 100644 --- a/blessclient/user_ip.py +++ b/blessclient/user_ip.py @@ -58,7 +58,8 @@ def _fetchIP(self, url): if c not in VALID_IP_CHARACTERS: raise ValueError("Public IP response included invalid character '{}'.".format(c)) return content - except Exception: + except Exception as e: + logging.debug(e) logging.debug('Could not refresh public IP from {}'.format(url), exc_info=True) return None diff --git a/blesswrapper/sshclient.py b/blesswrapper/sshclient.py index bd660ad..841d9d3 100644 --- a/blesswrapper/sshclient.py +++ b/blesswrapper/sshclient.py @@ -5,6 +5,7 @@ import os import sys import datetime +import re from blessclient.client import bless, get_region_from_code, get_regions, load_config from blessclient.bless_config import BlessConfig @@ -60,6 +61,11 @@ def main(): default=22, help='Port to connect to on the remote host. Default 22' ) + parser.add_argument( + '-F', + default=None, + help='Specifies an alternative per-user configuration file for ssh.' + ) args = parser.parse_args() if 'AWS_PROFILE' not in os.environ: @@ -72,6 +78,18 @@ def main(): sys.stderr.write('AWS session expired. Try running get_session first?\n') sys.exit(1) + try: + ssh_version = re.search('OpenSSH_([^\s]+)', subprocess.check_output(['ssh', '-V'], stderr=subprocess.STDOUT).decode('UTF-8')) + if '7.8' in ssh_version.group(0): + sys.stderr.write("""@@@@@@@ WARNING @@@@@@@ +There is a bug in OpenSSH version 7.8 that makes signed ssh keys not work, and thus Bless does not work. +From our knowledge, the bug only affects the ssh client. +sshd version 7.7 or 7.9 should work with Bless. +We detected that you are running {} +""".format(ssh_version.group(0))+'\n'+'-'*64) + except Exception as e: + sys.stderr.write('Failed to get OpenSSH client version\n') + ssh_options = [] if vars(args)['4']: ssh_options.append('-4') @@ -86,6 +104,9 @@ def main(): ssh_options.append('-X') if args.Y: ssh_options.append('-Y') + if args.F is not None: + ssh_options.append('-F') + ssh_options.append(args.F) hostname = None username = None