Link to home
Start Free TrialLog in
Avatar of spectrumsofttech
spectrumsofttechFlag for India

asked on

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:-

http://www.jcraft.com/jsch/examples/Sftp.java.html
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:)