daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PuTTY-User-Key-File-2: ssh-rsa
  2. Encryption: none
  3. Comment: rsa-key-test
  4. Public-Lines: 12
  5. ...
  6. Private-Lines: 28
  7. ...
  8.    
  9. ---- BEGIN SSH2 PUBLIC KEY ----
  10. Comment: "rsa-key-test"
  11. ...
  12. ---- END SSH2 PUBLIC KEY ----
  13.    
  14. jsch.setKnownHosts(filePath + "known_hosts");
  15.    
  16. 2018-12-07 15:22:14.900 [main] INFO  d.p.o.common.clients.SftpClient - com.jcraft.jsch.JSchException: invalid privatekey: [B@8e0379d
  17.    
  18. Jsch jsch = new JSch();
  19. Session session = null;
  20.  
  21. //add known hosts file for authentication
  22. jsch.setKnownHosts(filePath + "known_hosts");
  23.  
  24. keyPath = filePath + "privatekey.ppk";
  25. jsch.addIdentity(keyPath);
  26. session = jsch.getSession("test", "172.17.30.91", 22);
  27.  
  28. session.connect();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top