jsch登录时报错UnknownHostKey: xx.com.cn. RSA key fingerprint is dd:96:64:d6

476 阅读1分钟

jsch连接工商银行sftp报错

om.jcraft.jsch.JSchException: UnknownHostKey: gw.open.icbc.com.cn. RSA key fingerprint is dd:96:64:d6:26:58:23:49:f8:18:92:72:09:de:b9:15
	at com.jcraft.jsch.Session.checkHost(Session.java:805)
	at com.jcraft.jsch.Session.connect(Session.java:345)

可以在connect之前设置不校验

this.session = jSch.getSession(sshUser, sshHost, sshPort);
// 设置第一次登录的时候提示,可选值:(ask | yes | no)
this.session.setConfig("StrictHostKeyChecking", "no");
this.session.connect(10000);