I've noticed that with bouncy castle enabled and PEM keys being generated. The sshd server is unable to load existing EC private keys and always generates a throwaway key as seen in the logs. I'm also running ssh-keyscan to verify that a new host key is generated with each run of the server.
The ssh server fails to load the same EC private key that was generated on the first run of the server So, with bouncycastle enabled I always get a new server host key generated but I want to re-use the same PEM formatted EC host key after restarts. Is there a way to resolve this? public class ServerTest { public static void main(String[] args) { SshServer sshServer = SshServer.setUpDefaultServer(); sshServer.setHost("0.0.0.0"); sshServer.setPort(2222); sshServer.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory())); sshServer.setShellFactory(new ProcessShellFactory("/bin/sh", "-i", "-l")); sshServer.setPasswordAuthenticator(AcceptAllPasswordAuthenticator.INSTANCE); sshServer.setKeyPairProvider(SecurityUtils.createGeneratorHostKeyProvider(Paths.get("test-ec"))); ((AbstractGeneratorHostKeyProvider) sshServer.getKeyPairProvider()).setOverwriteAllowed(false); sshServer.start(); // truncated the rest of the sample code I've attached a log of the issue. Thank you,
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@mina.apache.org For additional commands, e-mail: users-h...@mina.apache.org