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 ๐Ÿ˜€

Advertisements
Categories: Tech Tags: , , ,