From db25b3f77e4a5611525ef257cc2fa020cba9d1eb Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 4 Jul 2024 09:52:14 +0200 Subject: [PATCH] Fix error with SSH keys --- IM/SSH.py | 3 +++ 1 file changed, 3 insertions(+) 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):