Archive

Archive for June, 2009

com.jcraft.jsch.JSchException: UnknownHostKey

June 24, 2009 6 comments

Hello 😀

Great title don’t you think?

If you try a ssh connection with JSch, a Java implementation of  SSH2, you may recognize the title as an error message 😀

To solve that error you can add the host to $HOME/.ssh or add the follow lines to your code:


java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no");
session.setConfig(config);

Two easy options to solve your problem 😀

Categories: Tech Tags: , , ,