[JSch-users] Trying to transport a file over sftp connection to remote server
Status: Alpha
Brought to you by:
ymnk
From: Lavanya T <lav...@gm...> - 2008-07-28 11:52:00
|
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. |