JAVA JSCH does not understan record format from known_host file

时间:2016-07-11 21:40:21

标签: java jsch unknown-host

I don't know how this works so I came here for help.

I use JSCH java library to ssh from one machine to another. My program fails indicating unknown host error. However the entry is in the known_host file.

I noticed that JSCH does not understand records from known_host file of this format:

|1|asdfasdfasdfasdfasdfasdsaf=|asdfasdfasdfadfas=ssh-rsa asdfasdfasdfasdfasd

but understands this format (I added it manually and it worked):

host ssh-rsa asgfsdfadfasdfadfasdfasdfasdfa

How to make in understand the first format? My config on Session is the following:

      this.sesConnection.setConfig("HashKnownHosts", "yes");
      this.sesConnection.setConfig("PreferredAuthentications","publickey,keyboard-interactive,password");

Thank you!

0 个答案:

没有答案