I’m hoping to set up a SFTP server in Java using Apache MINA.
It seems to start OK, but when I try to connect to it with an OpenSSH client, I get:
$ ssh
This works for me:
Change Maven pom.xml to remove "sshd-sftp", which is now part of "sshd-core":
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId>
<version>1.0.0</version>
</dependency>
Add to "startSftpServer
":
AbstractGeneratorHostKeyProvider hostKeyProvider =
new SimpleGeneratorHostKeyProvider(SERVER_KEY_FILE.toPath());
hostKeyProvider.setAlgorithm("RSA");
sshd.setKeyPairProvider(hostKeyProvider);
... there seems to be a lot of guesswork involved in using this library, which seems shady for a "security" lib.