I'm building an SFTP class responsible for listing the files of a remote directory. I'm using the JSch library to do so. I have a user set up already, and I can manually SSH to the remote server just fine. However, when JSch attempts to connect it responds with
com.jcraft.jsch.JSchException: Auth fail
One thing I noticed though; when I manually SSH onto the server, I see that it's using "PAM Authentication." What am I missing?
Properties config = new Properties();
config.put("StrictHostKeyChecking", "no");
Session session = jSch.getSession(username, destination, port);
session.setPassword(password);
session.setConfig(config);
session.connect();