The SimpleGeneratorHostKeyProvider uses its own serialization mechanism, so you can't use it with keys generated with ssh-keygen. Try the FileKeyPairProvider instead.
2014-04-19 10:46 GMT+02:00 Maheedhar <[email protected]>: > Hi, > > I create a ssh keypair using "ssh-keygen -t rsa" command in my linux > machine > > this generates a private key (say) key_path and a public key (say) > key_path.pub > > I create it as shown in this link > > https://unfuddle.com/support/docs/topics/ssh_keypair > <https://unfuddle.com/support/docs/topics/ssh_keypair> > > I then mention the path of the key(key_path) as mentioned below when i > configure my ssh server > > sshServer.setKeyPairProvider (new SimpleGeneratorHostKeyProvider > (key_path)); > > when i configure the ssh server, I make the configuration > > sshClient.setServerKeyVerifier (AcceptAllServerKeyVerifier.INSTANCE) ; > > In debug mode, I notice that when the ssh server tries to read my key, it > always returns null due to an invalid stream header exception and my key is > never read.The exception "java.io.StreamCorruptedException: invalid stream > header: 2D2D2D2D" is always thrown. This exception is thrown in the > doReadKeyPair() method of the class SimpleGeneratorHostKeyProvider. > > Please alert me as to where I might be going wrong and please tell me the > correct way to do it too. > > > > -- > View this message in context: > http://apache-mina.10907.n7.nabble.com/Serious-issue-in-SimpleGeneratorHostKeyProvider-class-tp41924.html > Sent from the Apache MINA User Forum mailing list archive at Nabble.com. >
