I program an application in Java. This application make a connection between two PC (One Windows and One Linux). My application must make a connection and make few commands. Among commands, I want transfer a file.
This connection is a SSH Connection with SCP protocol.
I succedded make a connection with JSCH, I find command for transfer a file but I have a problem at this moment.
My command for transfer the file is :
scp -r -p path1 ***@***.***.***.***:path2;
But when I launch the programm, I have this message :
Host '***.***.***.***' is not in the trusted hosts file.
(fingerprint md5 CLE)
Do you want to continue connecting? (y/n)
But, this message is in my console, in my Java application, so I don't send y or n. I make more search for known_host but that did not give anything.
I try this :
jsch.setKnownHosts(System.getProperty("user.home") + "/.ssh/known_hosts");
session.setConfig("StrictHostKeyChecking", "no");
Or this (in my file hosts):
ssh -o StrictHostKeyChecking=no username@hostname.com
Or this :
Host 192.168.0.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
But nothing works, I do not understand logic. Which host file should we modify? Which of the PCs I want to connect to, or which PC is connecting?
If you want more details of my program, say it to me.
Thanks !