private static void knownHosts(SecureShell sch) { DirectoryInfo home = FS.userHome(); if (home == null) return; var known_hosts = new FileInfo(Path.Combine(home.ToString(), ".ssh/known_hosts")); try { using (var s = new StreamReader(known_hosts.FullName)) { sch.SetKnownHosts(s); } } catch (FileNotFoundException) { // Oh well. They don't have a known hosts in home. } catch (IOException) { // Oh well. They don't have a known hosts in home. } }