mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/ssh: Load host keys only if strict_host_check is true
Loading host keys breaks setting up SSH connection (paramiko throws BadHostKeyException exception) if issuer does not want/need strict key matching. One use case for ignoring strict_host_check is automating virtual guests (i.e., over QEMU). Issuer may want to skip loading host keys and start with a blank list of known host keys for sure. Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
parent
e334f8816c
commit
be7e73db16
@ -397,7 +397,8 @@ class SshConnection(SshConnectionBase):
|
||||
|
||||
with _handle_paramiko_exceptions():
|
||||
client = SSHClient()
|
||||
client.load_system_host_keys()
|
||||
if self.strict_host_check:
|
||||
client.load_system_host_keys()
|
||||
client.set_missing_host_key_policy(policy)
|
||||
client.connect(
|
||||
hostname=self.host,
|
||||
|
Loading…
x
Reference in New Issue
Block a user