I have been unable to get an ssh key (generated with ssh-keygen) and
unencrypted to work. Logging my UserInfo object (which should just be a
stub in that there should be no user interactions) I am seeing a request for
a passphrase even though the key in unencrypted. Any suggestions are
appreciated.
-----BEGIN DSA PRIVATE KEY-----
MIIBugIBAAKBgQC+s5qRE5MpeKvYNVzZUqCE6EoNnl24YtWi+jOYIFOhuYViZukJ <snip>
Doing the following code wise:
JSch jsch = new JSch(); final byte[] prvkey =
privatekey.getBytes("US-ASCII"); jsch.addIdentity(
username, // String userName prvkey, // byte[]
privateKey null, // byte[] publicKey
null // byte[] passPhrase );
Session session = jsch.getSession(username, hostname,
Integer.parseInt(port));
<Snip UI stub creation>
session.setUserInfo(ui); session.connect();
Channel channel = session.openChannel("sftp"); channel.connect();
ChannelSftp c = (ChannelSftp) channel;
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users