/// <exception cref="NSch.JSchException"></exception> private static void KnownHosts(JSch sch, FS fs) { FilePath home = fs.UserHome(); if (home == null) { return; } FilePath known_hosts = new FilePath(new FilePath(home, ".ssh"), "known_hosts"); try { FileInputStream @in = new FileInputStream(known_hosts); try { sch.SetKnownHosts(@in); } finally { @in.Close(); } } catch (FileNotFoundException) { } catch (IOException) { } }