ssh: use only the first known host location for libssh

This commit is contained in:
Wez Furlong committed 2021-10-19 20:33:30 -07:00
1 parent 8be442e39b
commit 199fd6f52f
1 file changed
+4 -1
+4 -1
View File
@@ -120,7 +120,10 @@ impl SessionInner {
}
}
if let Some(kh) = self.config.get("userknownhostsfile") {
sess.set_option(libssh::SshOption::KnownHosts(Some(kh.to_string())))?;
for file in kh.split_whitespace() {
sess.set_option(libssh::SshOption::KnownHosts(Some(file.to_string())))?;
break;
}
}
sess.options_parse_config(None)?; // FIXME: overridden config path?