mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Add support ssh configs from /etc/openssh.
In Altlinux system config dir for openssh is /etc/openssh.
This commit is contained in:
parent
0b32e1586d
commit
9be8ecda06
3 changed files with 10 additions and 5 deletions
|
@ -151,11 +151,13 @@ class Connection(ConnectionBase):
|
|||
self.keyfile = os.path.expanduser("~/.ssh/known_hosts")
|
||||
|
||||
if C.HOST_KEY_CHECKING:
|
||||
try:
|
||||
#TODO: check if we need to look at several possible locations, possible for loop
|
||||
ssh.load_system_host_keys("/etc/ssh/ssh_known_hosts")
|
||||
except IOError:
|
||||
pass # file was not found, but not required to function
|
||||
for ssh_known_hosts in ("/etc/ssh/ssh_known_hosts", "/etc/openssh/ssh_known_hosts"):
|
||||
try:
|
||||
#TODO: check if we need to look at several possible locations, possible for loop
|
||||
ssh.load_system_host_keys(ssh_known_hosts)
|
||||
break
|
||||
except IOError:
|
||||
pass # file was not found, but not required to function
|
||||
ssh.load_system_host_keys()
|
||||
|
||||
ssh.set_missing_host_key_policy(MyAddPolicy(self._new_stdin, self))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue