1
我正在嘗試使用j2ssh SshClient而沒有成功。如何在密碼中使用sshtools SftpClient?
我正在嘗試使用專用RSA密鑰+密碼來打開連接。 我發現了我不知道的東西是寫的方法:
Properties properties = new Properties();
properties.put("Passphrase", "xyz");
properties.put("PrivateKey", "sftp_rsa");
properties.put("Username", "user");
properties.put("StrictHostKeyChecking", "no");
publicKeyAuthenticationClient.setPersistableProperties(properties);
int result = ssh.authenticate(publicKeyAuthenticationClient);
我使用setPersistableProperties方法加載持有的相關數據Properties對象。 我已將PrivateKey設置爲文件名,並將Passphrase設置爲相關密碼。
別的東西,我得到的提示:
The host hostname.host,1.1.1.1 is currently unknown to the system
The host key fingerprint is: 100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Always option disabled, host file is not writeable
Do you want to allow this host key? [Yes|No]
,我有嘗試使用StrictHostKeyChecking屬性設置爲「無」來刪除。 (當然沒有成功)
任何想法??
謝謝!