“no matching host key type found” - Apache MINA SFTP server

前端 未结 1 1587
遇见更好的自我
遇见更好的自我 2021-02-09 14:03

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          


        
1条回答
  •  旧时难觅i
    2021-02-09 14:41

    This works for me:

    Change Maven pom.xml to remove "sshd-sftp", which is now part of "sshd-core":

    
        org.apache.sshd
        sshd-core
        1.0.0
    
    

    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.

    0 讨论(0)
提交回复
热议问题