Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PuTTY-User-Key-File-2: ssh-rsa
- Encryption: none
- Comment: rsa-key-test
- Public-Lines: 12
- ...
- Private-Lines: 28
- ...
- ---- BEGIN SSH2 PUBLIC KEY ----
- Comment: "rsa-key-test"
- ...
- ---- END SSH2 PUBLIC KEY ----
- jsch.setKnownHosts(filePath + "known_hosts");
- 2018-12-07 15:22:14.900 [main] INFO d.p.o.common.clients.SftpClient - com.jcraft.jsch.JSchException: invalid privatekey: [B@8e0379d
- Jsch jsch = new JSch();
- Session session = null;
- //add known hosts file for authentication
- jsch.setKnownHosts(filePath + "known_hosts");
- keyPath = filePath + "privatekey.ppk";
- jsch.addIdentity(keyPath);
- session = jsch.getSession("test", "172.17.30.91", 22);
- session.connect();
Add Comment
Please, Sign In to add comment