Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
in Java FTP by (158k points)

A user asks, when connecting to SFTPs and both client and server supports ssh-rsa and ssh-dss key-pair algorithms, the client (edtFTPj/PRO library) always chooses ssh-dss. Is there a configuration to make it choose ssh-rsa over ssh-dss when both are available? When choosing ssh-dss, the connection fails and the files are not transferred.

1 Answer

0 votes
by (158k points)
Best answer

Yes, it does it by simple order, and by default ssh-dss is listed first. You can change the order in SSHFTPClient like this:

sshFTP.setAlgorithmEnabled(SSHFTPAlgorithm.KEY_RSA, true);
sshFTP.setAlgorithmEnabled(SSHFTPAlgorithm.KEY_DSA, true);

This puts them in the order ssh-rsa,ssh-dss.