diff --git a/IM/SSH.py b/IM/SSH.py index 287ecc84..79f91129 100644 --- a/IM/SSH.py +++ b/IM/SSH.py @@ -117,6 +117,9 @@ def __init__(self, host, user, passwd=None, private_key=None, port=22, proxy_hos if (private_key is not None and private_key.strip() != ""): # Avoid windows line endings private_key = private_key.replace("\r", "") + # Assure final newline + if not private_key.endswith("\n"): + private_key += "\n" self.private_key = private_key private_key_obj = StringIO() if os.path.isfile(private_key):