Skip to content

Commit

Permalink
ssh: create known_hosts entry, if it does not exist (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSasser authored Sep 25, 2021
1 parent 10ca62f commit 68e823d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions matrixctl/handlers/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from types import TracebackType
from typing import NamedTuple

from paramiko import AutoAddPolicy
from paramiko import SSHClient
from paramiko.channel import ChannelFile

Expand Down Expand Up @@ -59,6 +60,7 @@ def __init__(
self.user: str = getuser() if user is None else user
self.__client: SSHClient = SSHClient()
self.__client.load_system_host_keys()
self.__client.set_missing_host_key_policy(AutoAddPolicy())
self.__connect()

def __connect(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions news/231.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``paramiko`` now creates a ``known_hosts`` entry, if it does not exist.

0 comments on commit 68e823d

Please sign in to comment.