Thanks.

I have fixed this now -- details at
http://stackoverflow.com/questions/33690689/no-matching-host-key-type-found-apache-mina-sftp-server

> You ought to update to version 1.0 before moving on.

At the time, I couldn’t find a 1.0 version of "sshd-sftp"
I didn't realise that it is included in "sshd-core" v 1.0.

That wasn't the main fix though; I had to add in BouncyCastle and pass the 
right magic string to "hostKeyProvider.setAlgorithm".


-----Original Message-----
From: Stefan Magnus Landrø [mailto:stefan.lan...@gmail.com]
Sent: 13 November 2015 13:41
To: users@mina.apache.org
Subject: Re: Apache MINA SFTP server - "no matching host key type found"

You ought to update to version 1.0 before moving on.

Stefan

2015-11-13 11:11 GMT+01:00 Richard Bradley <richard.brad...@softwire.com>:

> Hi,
>
> 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:
> Unable to negotiate with ::1: no matching host key type found. Their
> offer: ssh-dss
>
> The Java app logs:
> ! java.lang.IllegalStateException: Unable to negotiate key exchange
> for server host key algorithms (client:
> ecdsa-sha2-nistp256-cert-...@openssh.com,
> ecdsa-sha2-nistp384-cert-...@openssh.com,
> ecdsa-sha2-nistp521-cert-...@openssh.com,ssh-ed25519-cert-v01@openssh.
> com,
> ssh-rsa-cert-...@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,e
> cdsa-sha2-nistp521,ssh-ed25519,ssh-rsa
> / server: ssh-dss)
> ! at
> org.apache.sshd.common.session.AbstractSession.negotiate(AbstractSessi
> on.java:1279)
> ~[sshd-core-1.0.0.jar:1.0.0]
>
> My Maven dependencies are:
>
>
> <dependency>
>     <groupId>org.apache.sshd</groupId>
>     <artifactId>sshd-sftp</artifactId>
>     <version>0.11.0</version>
> </dependency>
>
> <dependency>
>     <groupId>org.apache.sshd</groupId>
>     <artifactId>sshd-core</artifactId>
>     <version>1.0.0</version>
> </dependency>
>
>
> My app startup code looks like (copied from
> http://stackoverflow.com/a/8974515/8261 ) import
> org.apache.sshd.common.NamedFactory;
> import org.apache.sshd.server.Command; import
> org.apache.sshd.server.SshServer; import
> org.apache.sshd.server.auth.UserAuth;
> import org.apache.sshd.server.auth.UserAuthNoneFactory;
> import org.apache.sshd.server.command.ScpCommandFactory;
> import
> org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
> import org.apache.sshd.sftp.subsystem.SftpSubsystem;
>
>
> private void startSftpServer() throws IOException {
>     SshServer sshd = SshServer.setUpDefaultServer();
>     sshd.setPort(2222);
>     sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(
>             new File("hostkey.ser")));
>
>     List<NamedFactory<UserAuth>> userAuthFactories = new
> ArrayList<NamedFactory<UserAuth>>();
>     userAuthFactories.add(new UserAuthNoneFactory());
>     sshd.setUserAuthFactories(userAuthFactories);
>
>     sshd.setCommandFactory(new ScpCommandFactory());
>
>     List<NamedFactory<Command>> namedFactoryList = new
> ArrayList<NamedFactory<Command>>();
>     namedFactoryList.add(new SftpSubsystem.Factory());
>     sshd.setSubsystemFactories(namedFactoryList);
>
>     sshd.start();
> }
>
> How do I add more modern host key algorithms to the server?
>
> Thanks,
>
>
> Rich
>
>
> Richard Bradley
> Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575
>
> softwire
> Sunday Times Best Small Companies - UK top 25 five years running Web :
> www.softwire.com<http://www.softwire.com/> | Follow us on Twitter :
> @SoftwireUK<https://twitter.com/SoftwireUK>
> Addr : 110 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
> Softwire Technology Limited. Registered in England no. 3824658.
> Registered Office : Gallery Court, 28 Arcadia Avenue, Finchley,
> London. N3 2FG
>



--
BEKK Open
http://open.bekk.no

TesTcl - a unit test framework for iRules http://testcl.com
Richard Bradley
Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575

softwire
Sunday Times Best Small Companies - UK top 25 five years running
Web : www.softwire.com<http://www.softwire.com/> | Follow us on Twitter : 
@SoftwireUK<https://twitter.com/SoftwireUK>
Addr : 110 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
Softwire Technology Limited. Registered in England no. 3824658. Registered 
Office : Gallery Court, 28 Arcadia Avenue, Finchley, London. N3 2FG

Reply via email to