SFTP connection through Java asking for weird authentication

Thought I’d post an answer here since in case anyone else ends up running into a similar issue. Turns out I am missing a piece of code that makes all the difference. I just needed to add

session.setConfig("PreferredAuthentications", 
                  "publickey,keyboard-interactive,password");

before

session.connect();

and everything works perfectly now.

Leave a Comment