From 3157841d5ef0908e981d7af8e9cb7675e33263fc Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Wed, 3 Jul 2024 11:29:53 +0200 Subject: [PATCH] Fix error with SSH keys --- IM/SSH.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IM/SSH.py b/IM/SSH.py index 259b7b34d..7e57aef57 100644 --- a/IM/SSH.py +++ b/IM/SSH.py @@ -122,7 +122,8 @@ def __init__(self, host, user, passwd=None, private_key=None, port=22, proxy_hos private_key_obj.write(line) pkfile.close() else: - private_key_obj.write(private_key) + # Avoid windows line endings + private_key_obj.write(private_key.replace("\r", "")) private_key_obj.seek(0) self.private_key_obj = paramiko.RSAKey.from_private_key(