From cf2bbce46fcc5bad0400f654b080d7e79f661bf2 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Fri, 30 Sep 2022 21:29:06 +0300 Subject: [PATCH] v6.2.0.0 Changelog: https://roxy-wi.org/changelog#6_2_0 --- app/modules/ssh_connection.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/modules/ssh_connection.py b/app/modules/ssh_connection.py index dded7ca..30de019 100644 --- a/app/modules/ssh_connection.py +++ b/app/modules/ssh_connection.py @@ -5,6 +5,7 @@ from paramiko import SSHClient class SshConnection: def __init__(self, server_ip, ssh_port, ssh_user_name, ssh_user_password, ssh_enable, ssh_key_name=None): self.ssh = SSHClient() + self.ssh.load_system_host_keys() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.server_ip = server_ip self.ssh_port = ssh_port @@ -16,7 +17,7 @@ class SshConnection: def __enter__(self): try: if self.ssh_enable == 1: - k = paramiko.pkey.Pkey.from_private_key_file(self.ssh_key_name) + k = paramiko.pkey.load_private_key_file(self.ssh_key_name) self.ssh.connect( hostname=self.server_ip, port=self.ssh_port, diff --git a/requirements.txt b/requirements.txt index 87ecf90..d95e04f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ configparser>=3.5.0 -paramiko>=2.4.3 +paramiko-ng>=2.5.0 pytz>=2017.3 requests>=2.22.0 pyTelegramBotAPI>=3.6.3