I have tried everything including reformatting the key that KeyPair produces. I use the key produced and upload the public key to the server adding it to the authorized_keys2 file. Auth fail. I also tried importing a sever generated (ssh-keygen) private key; clearly the produced pub key was added to authorized_keys2. I cannot get pub key authentication to work with a linux server. Jsch is reading the key file; no file not found exceptions. The keys are fine as my application has a dialog that displays the keys text and it looks completely normal. Using the key generated by KeyPair I get an ssh error in /var/log/auth "bad decrypted len".
There apparently is extra bytes in the private key.
I think not setting kpair.vendor to VENDOR_OPENSSH results in the default key being VENDOR_FSECURE. I'm at work, I'll try this later tonight. I was just sifting through the class a bit.
Nope, the default is VENDOR_OPENSSH. Its right at the top. The problem with the "bad decrypt len", I think, is that when I modified the jsch KeyGen I'm generating a file that is larger than the key itself, this generated extra length that is causing the auth to fail.
Log in to post a comment.