I am trying to use j2ssh SshClient without success.
I am trying to open a connection using private RSA key + passphrase. I found something which I am not sure is the write approach:
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);
I am using the setPersistableProperties method to load a Properties object that hold the relevant data. I have set the PrivateKey to the file name , and Passphrase to the relevant Passphrase.
Something else is I get a prompt of:
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]
which I have tries to remove using the StrictHostKeyChecking property set to "no". (Without success of course)
Any idea??
Thanks!