From 7262ad7e1afa10900ab86596a0d868d448558e5a Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Mon, 20 Feb 2023 17:50:18 +0100 Subject: [PATCH] Ignore ssh known_hosts from home directory, use own --- src/revpicommander/ssh_tunneling/server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/revpicommander/ssh_tunneling/server.py b/src/revpicommander/ssh_tunneling/server.py index f716e07..3e7c8aa 100644 --- a/src/revpicommander/ssh_tunneling/server.py +++ b/src/revpicommander/ssh_tunneling/server.py @@ -13,7 +13,7 @@ import select from socketserver import BaseRequestHandler, ThreadingTCPServer from threading import Thread -from paramiko.client import SSHClient, WarningPolicy +from paramiko.client import MissingHostKeyPolicy, SSHClient from paramiko.rsakey import RSAKey from paramiko.ssh_exception import PasswordRequiredException from paramiko.transport import Transport @@ -71,8 +71,7 @@ class SSHLocalTunnel: self._th_server = Thread() self._ssh_client = SSHClient() - self._ssh_client.load_system_host_keys() - self._ssh_client.set_missing_host_key_policy(WarningPolicy()) + self._ssh_client.set_missing_host_key_policy(MissingHostKeyPolicy()) self._ssh_transport = None # type: Transport self._forward_server = None # type: ThreadingTCPServer