• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1090
  • Last Modified:

How to use JSCh for file transfer and download?

I trying to use JSCH SFTP for transferring file from remote client to local host and vice versa.  My problem is even after creating private key for the client using ssh-keygen -C "user@hostID" -t rsa, and adding   jsch.addIdentity(privateKey, passphrase), during connection it show warning like :-

"The authenticity of host 'hostID' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting?".

I know that including a statement "config.put("StrictHostKeyChecking", "no");" will not show this warning but it may not be the best practice in terms of security.

I'm using the following code as my reference:-

  • 2
1 Solution
That should only happen when connecting to the host for the first time usually. See http://en.wikibooks.org/wiki/OpenSSH/Utilities for good practice on that warning
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now