Hi,

Iam trying to connect to a remote server to transport a file using SFTP.
But iam getting the error as below -
com.jcraft.jsch.JSchException: UnknownHostKey: 10.10.16.10. RSA key
fingerprint is f0:f6:db:2b:7b:32:d9:21:c3:1f:61:67:b4:be:56:ab
    at com.jcraft.jsch.Session.checkHost(Session.java:696)
    at com.jcraft.jsch.Session.connect(Session.java:306)
    at com.jcraft.jsch.Session.connect(Session.java:149)

and my code part is here -

host ,username ,password and file are input arguments


           JSch jsch=new JSch();


            int port=22;
            jsch.setKnownHosts("10.10.16.10");
            Session session=jsch.getSession(sftpuser, sftphost, port);


              session.setPassword(sftppassword);

            session.connect();

            Channel channel=session.openChannel("sftp");
              channel.connect();
              ChannelSftp c=(ChannelSftp)channel;

              //OutputStream os = session.setOutputStream();

              c.put(sftpfile,targetsftpfile);


I could not find any detailed info for this on the internet. Can someone
help me with this please.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to