sshj icon indicating copy to clipboard operation
sshj copied to clipboard

Could not load known_hosts inside of docker

Open gillbates opened this issue 2 years ago • 1 comments

Hi Hierynomus,

it always throws an exception when running inside of a docker

ssh.loadKnownHosts();

java.io.IOException: Could not load known_hosts at net.schmizz.sshj.SSHClient.loadKnownHosts(SSHClient.java:650)

can we somehow fix this?

thx for all the efforts in advance ...

gillbates avatar Mar 15 '23 01:03 gillbates

Do you have a .ssh/known_hosts file? if not don't call loadKnownHosts. Use: ssh.addHostKeyVerifier(PromiscuousVerifier()) basically all hosts will be verified . for more security create a known_hosts file

lfmunoz avatar Aug 05 '23 18:08 lfmunoz