For EC2, Amazon issues ssh rsa private key files with an extra line before
"BEGIN RSA PRIVATE KEY" . It works fine with unix command line ssh, but when I
use that file with JSch I get
com.jcraft.jsch.JSchException: invalid privatekey: /home/dwalend/ec2/dwalend-key
at com.jcraft.jsch.IdentityFile.<init>(IdentityFile.java:224)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:135)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:130)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:206)
If I delete the extra line, things work fine in both ssh and JSch. Is Amazon
doing something they shouldn't? Or should JSch be looking for the "-----BEGIN
RSA PRIVATE KEY-----" before giving up?
The file looks like this:
KEYPAIR dwalend-key so:me:ki:nd:of:he:xf:in:ge:rp:ri:nt
-----BEGIN RSA PRIVATE KEY-----
MyKeyBlahBlahManyCharacters
ForSeveralLines
-----END RSA PRIVATE KEY-----
Thanks,
Dave
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users