Question

I tried the ssh lib jsch recently. I tried the example found here:

http://www.jcraft.com/jsch/examples/ScpTo.java

Is there a way to authenticate programatically, and not through the Java pop up windows? Theres a bunch of Swing components (or similar) that I dont want, I just need to put the password somwhere in the code.

I tried making my own impl of UserIno, but gor an authentication error.

thanks!

Ok, I found it myself. This is what u have to to:

session.setPassword(password.getBytes());
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
Was it helpful?

Solution 2

I edited the question above to contain a possible solution.

OTHER TIPS

yu need to set config.put("StrictHostKeyChecking", "no");

This is the trick

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top